Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't expose build errors to frontend #3498

Merged
merged 1 commit into from
Jan 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/hub/src/models/data/cards.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ const select = {
},
builds: {
select: {
// be careful with selecting errors here - potential security risk, build script doesn't take `isPrivate` into account
runSeconds: true,
errors: true,
},
orderBy: {
createdAt: "desc",
Expand Down
1 change: 1 addition & 0 deletions apps/hub/src/models/data/full.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ async function toDTO(row: Row): Promise<ModelFullDTO> {
select: {
builds: {
select: {
// be careful with selecting errors here - potential security risk, build script doesn't take `isPrivate` into account
runSeconds: true,
},
},
Expand Down
5 changes: 2 additions & 3 deletions apps/hub/src/models/data/revisions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export const selectModelRevision = {
// used for `buildStatus` and `lastBuild`
builds: {
select: {
errors: true,
errors: true, // selected for `buildStatus`
runSeconds: true,
},
orderBy: {
Expand Down Expand Up @@ -51,7 +51,7 @@ type DbModelRevisionBuild = DbModelRevision["builds"][number];

type ModelRevisionBuildDTO = {
runSeconds: number;
errors: string[];
// no errors here - potential security risk, build script doesn't take `isPrivate` into account
};

export type ModelRevisionDTO = {
Expand All @@ -67,7 +67,6 @@ export type ModelRevisionDTO = {
function buildToDTO(build: DbModelRevisionBuild): ModelRevisionBuildDTO {
return {
runSeconds: build.runSeconds,
errors: build.errors,
};
}

Expand Down
Loading