Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup of Bruno test collection #1205

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
1 change: 1 addition & 0 deletions test/Bruno/Altinn.Authorization/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# Bruno
.env
local

This file was deleted.

15 changes: 14 additions & 1 deletion test/Bruno/Altinn.Authorization/TestTokenGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ exports.getToken = async function (getTokenParameters) {
const tokenParty = getTokenParameters.auth_partyId;
const tokenPid = getTokenParameters.auth_ssn;

tokenUrl = `${tokenBaseUrl}/api/Get${tokenType}Token?env=${tokenEnv}&scopes=${tokenScopes}&pid=${tokenPid}&userid=${tokenUser}&partyid=${tokenParty}&authLvl=3&ttl=3000`;
tokenUrl = `${tokenBaseUrl}/api/Get${tokenType}Token?env=${tokenEnv}&scopes=${tokenScopes}&pid=${tokenPid}&userid=${tokenUser}&partyid=${tokenParty}&authLvl=3&ttl=30`;
}

else if (tokenType == "Enterprise") {
Expand All @@ -38,6 +38,19 @@ exports.getToken = async function (getTokenParameters) {
tokenUrl = `${tokenBaseUrl}/api/Get${tokenType}Token?env=${tokenEnv}&scopes=${tokenScopes}&orgNo=${tokenOrgNo}&userId=${tokenUser}&partyId=${tokenParty}&userName=${tokenUserName}&ttl=30`;
}

else if (tokenType == "PlatformAccessToken") {
const tokenOrg = getTokenParameters.auth_org;
const tokenApp = getTokenParameters.auth_app;

tokenUrl = `${tokenBaseUrl}/api/Get${tokenType}Token?env=${tokenEnv}&org=${tokenOrg}&app=${tokenApp}&ttl=30`;
}

else if (tokenType == "PlatformToken") {
const tokenApp = getTokenParameters.auth_app;

tokenUrl = `${tokenBaseUrl}/api/Get${tokenType}?env=${tokenEnv}&app=${tokenApp}&ttl=30`;
}

const response = await axios.get(tokenUrl, {
headers: { Authorization }
});
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

10 changes: 5 additions & 5 deletions test/Bruno/Altinn.Authorization/collection.bru
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ script:post-response {

docs {
Dokumentasjon havner i collection.bru filen i rotmappa.

# Støtter markdown
Ja, det gjør det!

## Undertittel
Her er en *undertittel*.

### under-undertittel
Her er en **under-undertittel**.

### Bullet points
* bullet point 1
* bullet point 2
- bullet point 3
- bullet point 4

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
meta {
name: devtest_gar_rrr_accesslist
type: http
seq: 1
}

post {
url: {{baseUrl}}/authorization/api/v1/accesslist/accessmanagement/authorization
body: json
auth: inherit
}

headers {
Content-Type: application/json
Ocp-Apim-Subscription-Key: {{apimSubscriptionKey}}
}

body:json {
{
"subject": {
"type": "urn:altinn:organization:identifier-no",
"value": "910459880"
},
"resource": {
"type": "urn:altinn:resource",
"value": "devtest_gar_rrr_accesslist"
},
"action": {
"type": "urn:oasis:names:tc:xacml:1.0:action:action-id",
"value": "whatever"
}
}
}

script:pre-request {
const sharedtestdata = require(`./Testdata/shared.json`);

var getTokenParameters = {
auth_tokenType: sharedtestdata.authTokenType.enterprise,
auth_scopes: sharedtestdata.auth_scopes.authorize,
auth_org: sharedtestdata.serviceOwners.ttd.org,
auth_orgNo: sharedtestdata.serviceOwners.ttd.orgno,
}

const token = await testTokenGenerator.getToken(getTokenParameters);
bru.setVar("bearerToken", token);
}
Loading
Loading