Skip to content

Commit 90df5e3

Browse files
committed
[server, spicedb] Introduce and integrate org env vars into internal services
1 parent 665cacc commit 90df5e3

File tree

8 files changed

+320
-83
lines changed

8 files changed

+320
-83
lines changed

components/gitpod-protocol/src/protocol.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,11 +277,12 @@ export namespace UserEnvVar {
277277
export const WILDCARD_DOUBLE_ASTERISK = "**";
278278
const WILDCARD_SHARP = "#"; // TODO(gpl) Where does this come from? Bc we have/had patterns as part of URLs somewhere, maybe...?
279279
const MIN_PATTERN_SEGMENTS = 2;
280+
export const GITPOD_IMAGE_AUTH_ENV_VAR_NAME = "GITPOD_IMAGE_AUTH";
280281

281282
/**
282283
* - GITPOD_IMAGE_AUTH is documented https://www.gitpod.io/docs/configure/workspaces/workspace-image#use-a-private-docker-image
283284
*/
284-
export const WhiteListFromReserved = ["GITPOD_IMAGE_AUTH"];
285+
export const WhiteListFromReserved = [GITPOD_IMAGE_AUTH_ENV_VAR_NAME];
285286

286287
function isWildcard(c: string): boolean {
287288
return c === WILDCARD_ASTERISK || c === WILDCARD_SHARP;

components/server/src/api/envvar-service-api.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,7 @@ export class EnvironmentVariableServiceAPI implements ServiceImpl<typeof Environ
207207
const { workspace } = await this.workspaceService.getWorkspace(ctxUserId(), req.workspaceId);
208208
const envVars = await this.envVarService.resolveEnvVariables(
209209
workspace.ownerId,
210+
workspace.organizationId,
210211
workspace.projectId,
211212
workspace.type,
212213
workspace.context,

components/server/src/authorization/definitions.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ export type OrganizationPermission =
6565
| "delete"
6666
| "read_settings"
6767
| "write_settings"
68+
| "read_env_var"
69+
| "write_env_var"
6870
| "read_audit_logs"
6971
| "read_members"
7072
| "invite_members"

0 commit comments

Comments
 (0)