Skip to content

Commit

Permalink
add production vars and revert debugging fields
Browse files Browse the repository at this point in the history
  • Loading branch information
storywithoutend committed Aug 20, 2024
1 parent 3a1452f commit c124c09
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 14 deletions.
24 changes: 15 additions & 9 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,20 @@ jobs:
- name: Install dependencies
run: bun install --frozen-lockfile

# - name: Deploy to production
# if: ${{ github.ref == 'refs/heads/main' }}
# uses: cloudflare/wrangler-action@v3
# with:
# apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
# accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Deploy to production
if: ${{ github.ref == 'refs/heads/main' }}
uses: cloudflare/wrangler-action@v3
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
command: deploy --env production
environment: production
secrets: |
DENTITY_CLIENT_SECRET
DENTITY_CLIENT_ID
env:
DENTITY_CLIENT_ID: ${{ secrets.DENTITY_CLIENT_ID }}
DENTITY_CLIENT_SECRET: ${{ secrets.DENTITY_CLIENT_SECRET }}

- name: Deploy to staging
if: ${{ github.ref != 'refs/heads/main' }}
Expand All @@ -36,6 +44,4 @@ jobs:
DENTITY_CLIENT_ID
env:
DENTITY_CLIENT_ID: ${{ secrets.DENTITY_STAGING_CLIENT_ID }}
DENTITY_CLIENT_SECRET: ${{ secrets.DENTITY_STAGING_CLIENT_SECRET }}
DENTITY_BASE_ENDPOINT: https://oidc.staging.dentity.com
APP_REDIRCT: https://ens.domains
DENTITY_CLIENT_SECRET: ${{ secrets.DENTITY_STAGING_CLIENT_SECRET }}
6 changes: 1 addition & 5 deletions src/routes/v1/dentity/fetchDentityFederatedToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const fetchDentityFederatedToken = async (

const { federated_token, ens_name, error: errorTitle, error_description, ...rest} = data as DentityFederatedTokenResponse

if (!federated_token || !ens_name) return error(400, {error : errorTitle, error_description, DENTITY_CLIENT_ID, code, APP_REDIRECT})
if (!federated_token || !ens_name) return error(400, {error : errorTitle, error_description})

const url = new URL(`${DENTITY_BASE_ENDPOINT}/oidc/vp-token`)
url.searchParams.append('federated_token', federated_token)
Expand All @@ -44,9 +44,5 @@ export const fetchDentityFederatedToken = async (
return json({
name: ens_name,
verifiedPresentationUri: url.toString(),
DENTITY_BASE_ENDPOINT,
...rest,
ens_name,
federated_token
})
}
6 changes: 6 additions & 0 deletions wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@ name = "auth-worker"
main = "src/index.ts"
compatibility_date = "2024-02-23"

[env.production]
name = "auth-worker"

[env.production.vars]
DENTITY_BASE_ENDPOINT = "https://oidc.dentity.com"
APP_REDIRECT = "https://ens.domains"

[env.staging]
name = "auth-worker-staging"
Expand Down

0 comments on commit c124c09

Please sign in to comment.