Skip to content

Commit 0c40ea9

Browse files
committed
fix secrets mismatch and remove b64
1 parent c00d72b commit 0c40ea9

File tree

3 files changed

+6
-17
lines changed

3 files changed

+6
-17
lines changed

.github/workflows/test-use-cases.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ jobs:
3838
uses: grafana/k6-action@e4714b734f2b0afaabeb7b4a69142745548ab9ec # v0.3.1
3939
env:
4040
base_url: ${{ secrets.BROKER_BASE_URL }}
41-
mp_client_id: ${{ secrets.USE_CASE_MASKINPORTEN_CLIENT_ID }}
42-
mp_kid: ${{ secrets.USE_CASE_MASKINPORTEN_KID }}
43-
mp_client_pem: ${{ secrets.USE_CASE_MASKINPORTEN_PEM }}
41+
mp_client_id: ${{ secrets.USECASE_MASKINPORTEN_CLIENT_ID }}
42+
mp_kid: ${{ secrets.USECASE_MASKINPORTEN_KID }}
43+
mp_client_pem: ${{ secrets.USECASE_MASKINPORTEN_PEM }}
4444
with:
4545
filename: tests/Altinn.Broker.UseCaseTests/case_initialize.js
4646

tests/Altinn.Broker.UseCaseTests/helpers/altinnTokenService.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import http from 'k6/http';
2-
import encoding from 'k6/encoding';
32
import { retrieveMaskinportenToken } from './maskinportenTokenService.js';
43

54
const authorizationBaseUrl = (__ENV.base_url.toLowerCase().includes('platform.altinn.no'))
@@ -21,28 +20,22 @@ async function retrieveAltinnToken({ baseUrl, clientId, kid, pem, scope, isSende
2120
}
2221

2322
export async function getSenderAltinnToken() {
24-
const pem = __ENV.mp_client_pem_b64
25-
? encoding.b64decode(__ENV.mp_client_pem_b64, 'std', 's').toString()
26-
: __ENV.mp_client_pem;
2723
return await retrieveAltinnToken({
2824
baseUrl: authorizationBaseUrl,
2925
clientId: __ENV.mp_client_id,
3026
kid: __ENV.mp_kid,
31-
pem,
27+
pem: __ENV.mp_client_pem,
3228
scope: 'altinn:broker.write',
3329
isSender: true
3430
});
3531
}
3632

3733
export async function getRecipientAltinnToken() {
38-
const pem = __ENV.mp_client_pem_b64
39-
? encoding.b64decode(__ENV.mp_client_pem_b64, 'std', 's').toString()
40-
: __ENV.mp_client_pem;
4134
return await retrieveAltinnToken({
4235
baseUrl: authorizationBaseUrl,
4336
clientId: __ENV.mp_client_id,
4437
kid: __ENV.mp_kid,
45-
pem,
38+
pem: __ENV.mp_client_pem,
4639
scope: 'altinn:broker.read altinn:serviceowner',
4740
isSender: false
4841
});

tests/Altinn.Broker.UseCaseTests/helpers/maskinportenTokenService.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import http from 'k6/http';
2-
import encoding from 'k6/encoding';
32
import { buildMaskinportenJwt } from './maskinportenJwtBuilder.js';
43

54
const maskinportenUrl = (__ENV.base_url.toLowerCase().includes('platform.altinn.no'))
@@ -20,13 +19,10 @@ export async function retrieveMaskinportenToken({ clientId, kid, pem, scope, isS
2019
}
2120

2221
export async function getMaintenanceMaskinportenToken() {
23-
const pem = __ENV.mp_client_pem_b64
24-
? encoding.b64decode(__ENV.mp_client_pem_b64, 'std', 's').toString()
25-
: __ENV.mp_client_pem;
2622
return await retrieveMaskinportenToken({
2723
clientId: __ENV.mp_client_id,
2824
kid: __ENV.mp_kid,
29-
pem,
25+
pem: __ENV.mp_client_pem,
3026
scope: 'altinn:broker.maintenance',
3127
});
3228
}

0 commit comments

Comments
 (0)