Skip to content
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 .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -341,5 +341,5 @@ ENV PRE_COMMIT_HOME=/workspace/.pre-commit

# Setting the environment variable here so that it will be accessible to all tasks and
# terminal sessions in Gitpod workspaces.
ENV PREVIEW_ENV_DEV_SA_KEY_PATH=
ENV PREVIEW_ENV_DEV_SA_KEY_PATH=/root/.config/gcloud/sa.json
ENV GOOGLE_EXTERNAL_ACCOUNT_ALLOW_EXECUTABLES=1
4 changes: 2 additions & 2 deletions dev/next-oidc/oidc.js → dev/flex-oidc/oidc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ const getIDToken = async () => {
const config = JSON.parse(fs.readFileSync(configPath, "utf8"));

const controlPlaneApiEndpoint = config.controlPlaneApiEndpoint;
const workspaceToken = config.workspaceToken;
const environmentToken = config.environmentToken;

const url = new URL(controlPlaneApiEndpoint);
const client = http2.connect(url.origin);

const req = client.request({
":method": "POST",
"content-type": "application/json",
authorization: `Bearer ${workspaceToken}`,
authorization: `Bearer ${environmentToken}`,
":path": `${url.pathname}/gitpod.v1.IdentityService/GetIDToken`,
});

Expand Down
4 changes: 2 additions & 2 deletions dev/preview/workflow/preview/configure-workspace.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ fi

if [ -f "/usr/local/gitpod/config/initial-spec.json" ]; then
gcloud iam workload-identity-pools create-cred-config \
projects/184212049955/locations/global/workloadIdentityPools/gitpod-next/providers/gitpod-next-provider \
projects/184212049955/locations/global/workloadIdentityPools/gitpod-flex/providers/gitpod-flex-provider \
--service-account=preview-environmnet-dev@gitpod-dev-preview.iam.gserviceaccount.com \
--service-account-token-lifetime-seconds=1h \
--output-file="${PREVIEW_ENV_DEV_SA_KEY_PATH}" \
--executable-command='node /workspace/gitpod/dev/next-oidc/oidc.js' \
--executable-command='node /workspace/gitpod/dev/flex-oidc/oidc.js' \
--executable-timeout-millis=5000
elif [[ -n "${PREVIEW_ENV_DEV_CRED:-}" ]]; then
echo "${PREVIEW_ENV_DEV_CRED}" >"${PREVIEW_ENV_DEV_SA_KEY_PATH}"
Expand Down
Loading