Skip to content

Commit

Permalink
ci(modeler): add modeler API url to workflow vars (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
jwulf authored Mar 18, 2024
1 parent 67174fc commit a8b8a31
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
environment: integration
steps:
- name: Check out the repo
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
Expand All @@ -35,6 +35,7 @@ jobs:
CAMUNDA_TASKLIST_BASE_URL: ${{ secrets.CAMUNDA_TASKLIST_BASE_URL }}
CAMUNDA_OPERATE_BASE_URL: ${{ secrets.CAMUNDA_OPERATE_BASE_URL }}
CAMUNDA_OPTIMIZE_BASE_URL: ${{ secrets.CAMUNDA_OPTIMIZE_BASE_URL }}
CAMUNDA_MODELER_BASE_URL: https://modeler.cloud.camunda.io/api
CAMUNDA_CONSOLE_CLIENT_ID: ${{ secrets.CAMUNDA_CONSOLE_CLIENT_ID }}
CAMUNDA_CONSOLE_CLIENT_SECRET: ${{ secrets.CAMUNDA_CONSOLE_CLIENT_SECRET }}
CAMUNDA_CONSOLE_BASE_URL: ${{ secrets.CAMUNDA_CONSOLE_BASE_URL }}
Expand Down
9 changes: 6 additions & 3 deletions src/oauth/lib/OAuthProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ export class OAuthProvider implements IOAuthProvider {
}

public async getToken(audienceType: TokenGrantAudienceType): Promise<string> {
// tslint:disable-next-line: no-console
// We use the Console credential set if it we are requesting from
// the SaaS OAuth endpoint, and it is a Modeler or Admin Console token.
// Otherwise we use the application credential set, unless a Console credential set exists.
Expand Down Expand Up @@ -237,6 +238,9 @@ export class OAuthProvider implements IOAuthProvider {
) {
return '' // No audience in token request
}
if (audienceType === 'MODELER' && this.isCamundaSaaS) {
return 'audience=api.cloud.camunda.io&'
}
return `audience=${this.getAudience(audienceType)}&`
}

Expand Down Expand Up @@ -334,9 +338,8 @@ export class OAuthProvider implements IOAuthProvider {
audience: TokenGrantAudienceType
) {
let token: Token
const tokenCachedInFile = fs.existsSync(
this.getCachedTokenFileName(clientId, audience)
)
const tokenFileName = this.getCachedTokenFileName(clientId, audience)
const tokenCachedInFile = fs.existsSync(tokenFileName)
if (!tokenCachedInFile) {
return null
}
Expand Down

0 comments on commit a8b8a31

Please sign in to comment.