├── LICENSE ├── README.md ├── Altinn_DEV.postman_environment.json ├── Altinn_TT02.postman_environment.json ├── Altinn_AT23.postman_environment.json └── altinn-delegations.postman_collection.json /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/altinn/MaskinportenApiPostman/master/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # MaskinportenAPI Postman Collection 2 | 3 | This is a Postman collection for testing MaskinportenAPI implemented at Altinn, based on [the Delegations API](https://app.swaggerhub.com/apis/Altinn/MaskinportenDelegation/). 4 | 5 | Utilizing the server part of https://github.com/Altinn/MaskinportenTokenGenerator in order to get access tokens from Maskinporten. 6 | 7 | ### Usage 8 | 1. Import as collection to Postman. 9 | 2. Import one or more of the environments to Postman, and adjust to your needs. 10 | 11 | ### License 12 | MIT 13 | -------------------------------------------------------------------------------- /Altinn_DEV.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "5490af34-695d-4fd3-8300-177508b0b151", 3 | "name": "Altinn DEV", 4 | "values": [ 5 | { 6 | "key": "baseUrl", 7 | "value": "http://devenv.altinn.no:91/maskinporten-api", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "accessToken", 12 | "value": "", 13 | "enabled": true 14 | }, 15 | { 16 | "key": "alwaysRefreshToken", 17 | "value": "false", 18 | "enabled": true 19 | }, 20 | { 21 | "key": "DefaultScope", 22 | "value": "altinn:serviceowner/organizations", 23 | "enabled": true 24 | }, 25 | { 26 | "key": "DefaultConsumerOrg", 27 | "value": "810421282", 28 | "enabled": true 29 | }, 30 | { 31 | "key": "DefaultSupplierOrg", 32 | "value": "910494368", 33 | "enabled": true 34 | }, 35 | { 36 | "key": "DefaultDelegationSchemeId", 37 | "value": "", 38 | "enabled": true 39 | }, 40 | { 41 | "key": "accesTokenExpires", 42 | "value": "", 43 | "enabled": true 44 | }, 45 | { 46 | "key": "scopes", 47 | "value": "", 48 | "enabled": true 49 | } 50 | ], 51 | "_postman_variable_scope": "environment", 52 | "_postman_exported_at": "2019-10-21T12:00:08.389Z", 53 | "_postman_exported_using": "Postman/7.9.0" 54 | } -------------------------------------------------------------------------------- /Altinn_TT02.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "261af3a7-603d-4882-b1c7-32289fe44b2c", 3 | "name": "Altinn TT02", 4 | "values": [ 5 | { 6 | "key": "baseUrl", 7 | "value": "https://tt02.altinn.no/maskinporten-api", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "accessToken", 12 | "value": "", 13 | "enabled": true 14 | }, 15 | { 16 | "key": "alwaysRefreshToken", 17 | "value": "false", 18 | "enabled": true 19 | }, 20 | { 21 | "key": "DefaultScope", 22 | "value": "altinn:serviceowner/organizations", 23 | "enabled": true 24 | }, 25 | { 26 | "key": "DefaultConsumerOrg", 27 | "value": " 910402021", 28 | "enabled": true 29 | }, 30 | { 31 | "key": "DefaultSupplierOrg", 32 | "value": "910693514", 33 | "enabled": true 34 | }, 35 | { 36 | "key": "DefaultDelegationSchemeId", 37 | "value": "", 38 | "enabled": true 39 | }, 40 | { 41 | "key": "accesTokenExpires", 42 | "value": "", 43 | "enabled": true 44 | }, 45 | { 46 | "key": "scopes", 47 | "value": "", 48 | "enabled": true 49 | } 50 | ], 51 | "_postman_variable_scope": "environment", 52 | "_postman_exported_at": "2019-10-21T12:00:14.661Z", 53 | "_postman_exported_using": "Postman/7.9.0" 54 | } -------------------------------------------------------------------------------- /Altinn_AT23.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "94b8172b-ecb4-4e2e-b215-9d1a83519b19", 3 | "name": "Altinn AT23", 4 | "values": [ 5 | { 6 | "key": "baseUrl", 7 | "value": "https://at23.altinn.cloud/maskinporten-api", 8 | "enabled": true 9 | }, 10 | { 11 | "key": "accessToken", 12 | "value": "", 13 | "enabled": true 14 | }, 15 | { 16 | "key": "alwaysRefreshToken", 17 | "value": "false", 18 | "enabled": true 19 | }, 20 | { 21 | "key": "DefaultScope", 22 | "value": "altinn:serviceowner/organizations", 23 | "enabled": true 24 | }, 25 | { 26 | "key": "DefaultConsumerOrg", 27 | "value": " 910402021", 28 | "enabled": true 29 | }, 30 | { 31 | "key": "DefaultSupplierOrg", 32 | "value": "910693514", 33 | "enabled": true 34 | }, 35 | { 36 | "key": "DefaultDelegationSchemeId", 37 | "value": "", 38 | "enabled": true 39 | }, 40 | { 41 | "key": "accesTokenExpires", 42 | "value": "", 43 | "enabled": true 44 | }, 45 | { 46 | "key": "scopes", 47 | "value": "", 48 | "enabled": true 49 | } 50 | ], 51 | "_postman_variable_scope": "environment", 52 | "_postman_exported_at": "2019-11-19T08:50:55.627Z", 53 | "_postman_exported_using": "Postman/7.9.0" 54 | } -------------------------------------------------------------------------------- /altinn-delegations.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "f6619dd1-d6a5-4adb-b5e3-4f762de15251", 4 | "name": "Maskinporten Delegeringskilde API", 5 | "description": "API som delegeringskilder må implementere for integrasjon med Maskinportens tilgangskontroll.\n\nBenytter seg av et pre-request script som henter token via https://github.com/elsand/MaskinportenTokenGenerator\n\nContact Support:\n Name: Bjørn Dybvik Langfors\n Email: bdl@brreg.no", 6 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 7 | }, 8 | "item": [ 9 | { 10 | "name": "Delegation Schemes", 11 | "item": [ 12 | { 13 | "name": "Opprett og list ut alle", 14 | "item": [ 15 | { 16 | "name": "Opprett et delegeringsoppsett", 17 | "event": [ 18 | { 19 | "listen": "test", 20 | "script": { 21 | "id": "7cc50db1-2ece-4294-a423-f2299e015269", 22 | "exec": [ 23 | "pm.test(\"Successful POST request\", function () {", 24 | " pm.expect(pm.response.code).to.be.oneOf([201]);", 25 | "});", 26 | "", 27 | "pm.test(\"Body contains GUID\", function () {", 28 | " pm.response.to.have.body(/^\"[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\"$/);", 29 | "});", 30 | "", 31 | "pm.environment.set(\"DefaultDelegationSchemeId\", pm.response.json());" 32 | ], 33 | "type": "text/javascript" 34 | } 35 | } 36 | ], 37 | "request": { 38 | "method": "POST", 39 | "header": [ 40 | { 41 | "key": "Content-Type", 42 | "value": "application/json" 43 | } 44 | ], 45 | "body": { 46 | "mode": "raw", 47 | "raw": "{\r\n \"owner_org\": \"974760673\",\r\n \"scopes\": [ \r\n \"altinn:ettellerannetscope.read\",\r\n \"altinn:ettellerannetscope.write\"\r\n ],\r\n \"title\": [\r\n {\r\n \"code\": \"nb_NO\",\r\n \"value\": \"Test-API for demo\"\r\n },\r\n {\r\n \"code\": \"nn_NO\",\r\n \"value\": \"Test-API for ein demo\"\r\n },\r\n {\r\n \"code\": \"en\",\r\n \"value\": \"Test-API for a demo\"\r\n }\r\n ],\r\n \"description\": [\r\n {\r\n \"code\": \"nb_NO\",\r\n \"value\": \"Denne tjenesten gir full tilgang til et test-API\"\r\n },\r\n {\r\n \"code\": \"nn_NO\",\r\n \"value\": \"Denne tenesta gir full tilgang til eit test-API\"\r\n },\r\n {\r\n \"code\": \"en\",\r\n \"value\": \"This service grants full access to a test API\"\r\n } \r\n ],\r\n \"default_language\": \"nb_NO\"\r\n}" 48 | }, 49 | "url": { 50 | "raw": "{{baseUrl}}/delegationSchemes", 51 | "host": [ 52 | "{{baseUrl}}" 53 | ], 54 | "path": [ 55 | "delegationSchemes" 56 | ] 57 | }, 58 | "description": "Lager et nytt delegeringsoppsett." 59 | }, 60 | "response": [ 61 | { 62 | "name": "Ugyldig delegeringsoppsett. Se respons for nærmere forklaring.", 63 | "originalRequest": { 64 | "method": "POST", 65 | "header": [ 66 | { 67 | "key": "Content-Type", 68 | "value": "application/json" 69 | } 70 | ], 71 | "body": { 72 | "mode": "raw", 73 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 74 | }, 75 | "url": { 76 | "raw": "{{baseUrl}}/delegationSchemes", 77 | "host": [ 78 | "{{baseUrl}}" 79 | ], 80 | "path": [ 81 | "delegationSchemes" 82 | ] 83 | } 84 | }, 85 | "status": "Bad Request", 86 | "code": 400, 87 | "_postman_previewlanguage": "json", 88 | "header": [ 89 | { 90 | "key": "Content-Type", 91 | "value": "application/json" 92 | } 93 | ], 94 | "cookie": [], 95 | "body": "{\n \"error_code\": 4030,\n \"error_description\": \"The delegation scheme is invalid: one or more of the role codes supplied are invalid\"\n}" 96 | }, 97 | { 98 | "name": "Delegeringsoppsettet er opprettet.", 99 | "originalRequest": { 100 | "method": "POST", 101 | "header": [ 102 | { 103 | "key": "Content-Type", 104 | "value": "application/json" 105 | } 106 | ], 107 | "body": { 108 | "mode": "raw", 109 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 110 | }, 111 | "url": { 112 | "raw": "{{baseUrl}}/delegationSchemes", 113 | "host": [ 114 | "{{baseUrl}}" 115 | ], 116 | "path": [ 117 | "delegationSchemes" 118 | ] 119 | } 120 | }, 121 | "status": "Created", 122 | "code": 201, 123 | "_postman_previewlanguage": "json", 124 | "header": [ 125 | { 126 | "key": "Content-Type", 127 | "value": "application/json" 128 | } 129 | ], 130 | "cookie": [], 131 | "body": "\"\"" 132 | }, 133 | { 134 | "name": "Ingen tilgang til å opprette oppgitt delegeringsoppsett. Se respons for nærmere forklaring.", 135 | "originalRequest": { 136 | "method": "POST", 137 | "header": [ 138 | { 139 | "key": "Content-Type", 140 | "value": "application/json" 141 | } 142 | ], 143 | "body": { 144 | "mode": "raw", 145 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 146 | }, 147 | "url": { 148 | "raw": "{{baseUrl}}/delegationSchemes", 149 | "host": [ 150 | "{{baseUrl}}" 151 | ], 152 | "path": [ 153 | "delegationSchemes" 154 | ] 155 | } 156 | }, 157 | "status": "Forbidden", 158 | "code": 403, 159 | "_postman_previewlanguage": "json", 160 | "header": [ 161 | { 162 | "key": "Content-Type", 163 | "value": "application/json" 164 | } 165 | ], 166 | "cookie": [], 167 | "body": "{\n \"error_code\": 4031,\n \"error_description\": \"You do not have access to create a schema with one or more of the supplied scopes\"\n}" 168 | } 169 | ] 170 | }, 171 | { 172 | "name": "Slett et delegeringsoppsett ", 173 | "event": [ 174 | { 175 | "listen": "test", 176 | "script": { 177 | "id": "7cc50db1-2ece-4294-a423-f2299e015269", 178 | "exec": [ 179 | "pm.test(\"Successful POST request\", function () {", 180 | " pm.expect(pm.response.code).to.be.oneOf([201]);", 181 | "});", 182 | "", 183 | "pm.test(\"Body contains GUID\", function () {", 184 | " pm.response.to.have.body(/^\"[0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}\"$/);", 185 | "});", 186 | "", 187 | "pm.environment.set(\"DefaultDelegationSchemeId\", pm.response.json());" 188 | ], 189 | "type": "text/javascript" 190 | } 191 | } 192 | ], 193 | "request": { 194 | "method": "DELETE", 195 | "header": [ 196 | { 197 | "key": "Content-Type", 198 | "value": "application/json" 199 | } 200 | ], 201 | "body": { 202 | "mode": "raw", 203 | "raw": "" 204 | }, 205 | "url": { 206 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId", 207 | "host": [ 208 | "{{baseUrl}}" 209 | ], 210 | "path": [ 211 | "delegationSchemes", 212 | ":delegationSchemeId" 213 | ], 214 | "variable": [ 215 | { 216 | "key": "delegationSchemeId", 217 | "value": "{{DefaultDelegationSchemeId}}" 218 | } 219 | ] 220 | }, 221 | "description": "Slett et delegeringsoppsett." 222 | }, 223 | "response": [ 224 | { 225 | "name": "Ugyldig delegeringsoppsett. Se respons for nærmere forklaring.", 226 | "originalRequest": { 227 | "method": "POST", 228 | "header": [ 229 | { 230 | "key": "Content-Type", 231 | "value": "application/json" 232 | } 233 | ], 234 | "body": { 235 | "mode": "raw", 236 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 237 | }, 238 | "url": { 239 | "raw": "{{baseUrl}}/delegationSchemes", 240 | "host": [ 241 | "{{baseUrl}}" 242 | ], 243 | "path": [ 244 | "delegationSchemes" 245 | ] 246 | } 247 | }, 248 | "status": "Bad Request", 249 | "code": 400, 250 | "_postman_previewlanguage": "json", 251 | "header": [ 252 | { 253 | "key": "Content-Type", 254 | "value": "application/json" 255 | } 256 | ], 257 | "cookie": [], 258 | "body": "{\n \"error_code\": 4030,\n \"error_description\": \"The delegation scheme is invalid: one or more of the role codes supplied are invalid\"\n}" 259 | }, 260 | { 261 | "name": "Delegeringsoppsettet er opprettet.", 262 | "originalRequest": { 263 | "method": "POST", 264 | "header": [ 265 | { 266 | "key": "Content-Type", 267 | "value": "application/json" 268 | } 269 | ], 270 | "body": { 271 | "mode": "raw", 272 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 273 | }, 274 | "url": { 275 | "raw": "{{baseUrl}}/delegationSchemes", 276 | "host": [ 277 | "{{baseUrl}}" 278 | ], 279 | "path": [ 280 | "delegationSchemes" 281 | ] 282 | } 283 | }, 284 | "status": "Created", 285 | "code": 201, 286 | "_postman_previewlanguage": "json", 287 | "header": [ 288 | { 289 | "key": "Content-Type", 290 | "value": "application/json" 291 | } 292 | ], 293 | "cookie": [], 294 | "body": "\"\"" 295 | }, 296 | { 297 | "name": "Ingen tilgang til å opprette oppgitt delegeringsoppsett. Se respons for nærmere forklaring.", 298 | "originalRequest": { 299 | "method": "POST", 300 | "header": [ 301 | { 302 | "key": "Content-Type", 303 | "value": "application/json" 304 | } 305 | ], 306 | "body": { 307 | "mode": "raw", 308 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 309 | }, 310 | "url": { 311 | "raw": "{{baseUrl}}/delegationSchemes", 312 | "host": [ 313 | "{{baseUrl}}" 314 | ], 315 | "path": [ 316 | "delegationSchemes" 317 | ] 318 | } 319 | }, 320 | "status": "Forbidden", 321 | "code": 403, 322 | "_postman_previewlanguage": "json", 323 | "header": [ 324 | { 325 | "key": "Content-Type", 326 | "value": "application/json" 327 | } 328 | ], 329 | "cookie": [], 330 | "body": "{\n \"error_code\": 4031,\n \"error_description\": \"You do not have access to create a schema with one or more of the supplied scopes\"\n}" 331 | } 332 | ] 333 | }, 334 | { 335 | "name": "Lister ut alle delegeringsoppsett", 336 | "event": [ 337 | { 338 | "listen": "test", 339 | "script": { 340 | "id": "e7cb9448-c4b8-4944-a7e9-106db5d6e4bd", 341 | "exec": [ 342 | "pm.test(\"Status code is 200\", function () {", 343 | " pm.response.to.have.status(200);", 344 | "});", 345 | "", 346 | "pm.test(\"At least one delegation scheme is registered\", function () {", 347 | " var jsonData = pm.response.json();", 348 | " pm.expect(jsonData).to.not.be.empty;", 349 | "});", 350 | "" 351 | ], 352 | "type": "text/javascript" 353 | } 354 | } 355 | ], 356 | "request": { 357 | "method": "GET", 358 | "header": [], 359 | "url": { 360 | "raw": "{{baseUrl}}/delegationSchemes?", 361 | "host": [ 362 | "{{baseUrl}}" 363 | ], 364 | "path": [ 365 | "delegationSchemes" 366 | ], 367 | "query": [ 368 | { 369 | "key": "owner_orgno", 370 | "value": "974760673", 371 | "disabled": true 372 | } 373 | ] 374 | }, 375 | "description": "Returnerer en liste over alle delegeringsoppsett, valgfritt filtrert på organisasjonsnummer" 376 | }, 377 | "response": [ 378 | { 379 | "name": "Returnerer en liste av delegeringsoppsett", 380 | "originalRequest": { 381 | "method": "GET", 382 | "header": [], 383 | "url": { 384 | "raw": "{{baseUrl}}/delegationSchemes?owner_orgno=", 385 | "host": [ 386 | "{{baseUrl}}" 387 | ], 388 | "path": [ 389 | "delegationSchemes" 390 | ], 391 | "query": [ 392 | { 393 | "key": "owner_orgno", 394 | "value": "" 395 | } 396 | ] 397 | } 398 | }, 399 | "status": "OK", 400 | "code": 200, 401 | "_postman_previewlanguage": "json", 402 | "header": [ 403 | { 404 | "key": "Content-Type", 405 | "value": "application/json" 406 | } 407 | ], 408 | "cookie": [], 409 | "body": "[\n {\n \"scopes\": [\n \"\",\n \"\"\n ],\n \"title\": [\n {\n \"code\": \"\",\n \"value\": \"\"\n },\n {\n \"code\": \"\",\n \"value\": \"\"\n }\n ],\n \"description\": [\n {\n \"code\": \"\",\n \"value\": \"\"\n },\n {\n \"code\": \"\",\n \"value\": \"\"\n }\n ],\n \"delegation_source\": \"\",\n \"delegation_scheme_id\": \"\",\n \"owner_org\": \"\",\n \"default_language\": \"\",\n \"delegation_source_config\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n },\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"created\": \"\",\n \"last_changed\": \"\"\n },\n {\n \"scopes\": [\n \"\",\n \"\"\n ],\n \"title\": [\n {\n \"code\": \"\",\n \"value\": \"\"\n },\n {\n \"code\": \"\",\n \"value\": \"\"\n }\n ],\n \"description\": [\n {\n \"code\": \"\",\n \"value\": \"\"\n },\n {\n \"code\": \"\",\n \"value\": \"\"\n }\n ],\n \"delegation_source\": \"\",\n \"delegation_scheme_id\": \"\",\n \"owner_org\": \"\",\n \"default_language\": \"\",\n \"delegation_source_config\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n },\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"created\": \"\",\n \"last_changed\": \"\"\n }\n]" 410 | }, 411 | { 412 | "name": "Oppgitt organisasjonsnummer finnes ikke eller er ugyldig", 413 | "originalRequest": { 414 | "method": "GET", 415 | "header": [], 416 | "url": { 417 | "raw": "{{baseUrl}}/delegationSchemes?owner_orgno=", 418 | "host": [ 419 | "{{baseUrl}}" 420 | ], 421 | "path": [ 422 | "delegationSchemes" 423 | ], 424 | "query": [ 425 | { 426 | "key": "owner_orgno", 427 | "value": "" 428 | } 429 | ] 430 | } 431 | }, 432 | "status": "Bad Request", 433 | "code": 400, 434 | "_postman_previewlanguage": "json", 435 | "header": [ 436 | { 437 | "key": "Content-Type", 438 | "value": "application/json" 439 | } 440 | ], 441 | "cookie": [], 442 | "body": "{\n \"error_code\": 4001,\n \"error_description\": \"Supplied organization number is invalid or does not exist\"\n}" 443 | }, 444 | { 445 | "name": "Ingen tilgang til å hente ut liste over delegeringsoppsett.", 446 | "originalRequest": { 447 | "method": "GET", 448 | "header": [], 449 | "url": { 450 | "raw": "{{baseUrl}}/delegationSchemes?owner_orgno=", 451 | "host": [ 452 | "{{baseUrl}}" 453 | ], 454 | "path": [ 455 | "delegationSchemes" 456 | ], 457 | "query": [ 458 | { 459 | "key": "owner_orgno", 460 | "value": "" 461 | } 462 | ] 463 | } 464 | }, 465 | "status": "Forbidden", 466 | "code": 403, 467 | "_postman_previewlanguage": "text", 468 | "header": [ 469 | { 470 | "key": "Content-Type", 471 | "value": "text/plain" 472 | } 473 | ], 474 | "cookie": [], 475 | "body": "" 476 | } 477 | ] 478 | } 479 | ], 480 | "event": [ 481 | { 482 | "listen": "prerequest", 483 | "script": { 484 | "id": "2e018df0-cbb3-4a45-b6cb-860ec92cc256", 485 | "type": "text/javascript", 486 | "exec": [ 487 | "" 488 | ] 489 | } 490 | }, 491 | { 492 | "listen": "test", 493 | "script": { 494 | "id": "6ed69a97-624b-4749-bd87-bb11d4204c8b", 495 | "type": "text/javascript", 496 | "exec": [ 497 | "" 498 | ] 499 | } 500 | } 501 | ], 502 | "protocolProfileBehavior": {}, 503 | "_postman_isSubFolder": true 504 | }, 505 | { 506 | "name": "Operasjoner på enkelt-DS", 507 | "item": [ 508 | { 509 | "name": "Operasjoner for admin. av scopes", 510 | "item": [ 511 | { 512 | "name": "Hent liste over alle scopes for et delegeringsoppsett", 513 | "event": [ 514 | { 515 | "listen": "test", 516 | "script": { 517 | "id": "9a673468-e94b-4dcc-8fe6-9adce8d2e003", 518 | "exec": [ 519 | "pm.test(\"Status code is 200\", function () {", 520 | " pm.response.to.have.status(200);", 521 | "});", 522 | "", 523 | "pm.test(\"Three scopes for this delegation scheme\", function () {", 524 | " var jsonData = pm.response.json();", 525 | " pm.expect(jsonData).to.have.lengthOf(3);", 526 | "});", 527 | "" 528 | ], 529 | "type": "text/javascript" 530 | } 531 | } 532 | ], 533 | "request": { 534 | "method": "GET", 535 | "header": [], 536 | "url": { 537 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId/scopes", 538 | "host": [ 539 | "{{baseUrl}}" 540 | ], 541 | "path": [ 542 | "delegationSchemes", 543 | ":delegationSchemeId", 544 | "scopes" 545 | ], 546 | "variable": [ 547 | { 548 | "key": "delegationSchemeId", 549 | "value": "{{DefaultDelegationSchemeId}}", 550 | "description": "ID på delegeringsoppsett" 551 | } 552 | ] 553 | } 554 | }, 555 | "response": [ 556 | { 557 | "name": "Liste av scopes", 558 | "originalRequest": { 559 | "method": "GET", 560 | "header": [], 561 | "url": { 562 | "raw": "{{baseUrl}}/delegationSchemes//scopes", 563 | "host": [ 564 | "{{baseUrl}}" 565 | ], 566 | "path": [ 567 | "delegationSchemes", 568 | "", 569 | "scopes" 570 | ] 571 | } 572 | }, 573 | "status": "OK", 574 | "code": 200, 575 | "_postman_previewlanguage": "json", 576 | "header": [ 577 | { 578 | "key": "Content-Type", 579 | "value": "application/json" 580 | } 581 | ], 582 | "cookie": [], 583 | "body": "[\n \"\",\n \"\"\n]" 584 | }, 585 | { 586 | "name": "Oppgitt delegeringoppsett-ID finnes ikke", 587 | "originalRequest": { 588 | "method": "GET", 589 | "header": [], 590 | "url": { 591 | "raw": "{{baseUrl}}/delegationSchemes//scopes", 592 | "host": [ 593 | "{{baseUrl}}" 594 | ], 595 | "path": [ 596 | "delegationSchemes", 597 | "", 598 | "scopes" 599 | ] 600 | } 601 | }, 602 | "status": "Not Found", 603 | "code": 404, 604 | "_postman_previewlanguage": "text", 605 | "header": [ 606 | { 607 | "key": "Content-Type", 608 | "value": "text/plain" 609 | } 610 | ], 611 | "cookie": [], 612 | "body": "" 613 | }, 614 | { 615 | "name": "Ikke tilgang til å hente oppgitt delegeringsoppsett.", 616 | "originalRequest": { 617 | "method": "GET", 618 | "header": [], 619 | "url": { 620 | "raw": "{{baseUrl}}/delegationSchemes//scopes", 621 | "host": [ 622 | "{{baseUrl}}" 623 | ], 624 | "path": [ 625 | "delegationSchemes", 626 | "", 627 | "scopes" 628 | ] 629 | } 630 | }, 631 | "status": "Forbidden", 632 | "code": 403, 633 | "_postman_previewlanguage": "text", 634 | "header": [ 635 | { 636 | "key": "Content-Type", 637 | "value": "text/plain" 638 | } 639 | ], 640 | "cookie": [], 641 | "body": "" 642 | } 643 | ] 644 | }, 645 | { 646 | "name": "Knytt oppgitt scope med oppgitt delegeringsoppsett", 647 | "request": { 648 | "method": "POST", 649 | "header": [], 650 | "url": { 651 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId/scopes/?scope=altinn:foo/bar", 652 | "host": [ 653 | "{{baseUrl}}" 654 | ], 655 | "path": [ 656 | "delegationSchemes", 657 | ":delegationSchemeId", 658 | "scopes", 659 | "" 660 | ], 661 | "query": [ 662 | { 663 | "key": "scope", 664 | "value": "altinn:foo/bar" 665 | } 666 | ], 667 | "variable": [ 668 | { 669 | "description": "ID for delegeringsoppsett", 670 | "key": "delegationSchemeId", 671 | "value": "{{DefaultDelegationSchemeId}}" 672 | } 673 | ] 674 | } 675 | }, 676 | "response": [ 677 | { 678 | "name": "Delegeringsoppsett ikke funnet", 679 | "originalRequest": { 680 | "method": "PUT", 681 | "header": [], 682 | "url": { 683 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 684 | "host": [ 685 | "{{baseUrl}}" 686 | ], 687 | "path": [ 688 | "delegationSchemes", 689 | "", 690 | "scopes", 691 | ":scope" 692 | ], 693 | "variable": [ 694 | { 695 | "key": "scope" 696 | } 697 | ] 698 | } 699 | }, 700 | "status": "Not Found", 701 | "code": 404, 702 | "_postman_previewlanguage": "text", 703 | "header": [ 704 | { 705 | "key": "Content-Type", 706 | "value": "text/plain" 707 | } 708 | ], 709 | "cookie": [], 710 | "body": "" 711 | }, 712 | { 713 | "name": "Scope lagt til delegeringsoppsett", 714 | "originalRequest": { 715 | "method": "PUT", 716 | "header": [], 717 | "url": { 718 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 719 | "host": [ 720 | "{{baseUrl}}" 721 | ], 722 | "path": [ 723 | "delegationSchemes", 724 | "", 725 | "scopes", 726 | ":scope" 727 | ], 728 | "variable": [ 729 | { 730 | "key": "scope" 731 | } 732 | ] 733 | } 734 | }, 735 | "status": "No Content", 736 | "code": 204, 737 | "_postman_previewlanguage": "text", 738 | "header": [ 739 | { 740 | "key": "Content-Type", 741 | "value": "text/plain" 742 | } 743 | ], 744 | "cookie": [], 745 | "body": "" 746 | }, 747 | { 748 | "name": "Ikke tilgang til å hente oppgitt delegeringsoppsett.", 749 | "originalRequest": { 750 | "method": "PUT", 751 | "header": [], 752 | "url": { 753 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 754 | "host": [ 755 | "{{baseUrl}}" 756 | ], 757 | "path": [ 758 | "delegationSchemes", 759 | "", 760 | "scopes", 761 | ":scope" 762 | ], 763 | "variable": [ 764 | { 765 | "key": "scope" 766 | } 767 | ] 768 | } 769 | }, 770 | "status": "Forbidden", 771 | "code": 403, 772 | "_postman_previewlanguage": "text", 773 | "header": [ 774 | { 775 | "key": "Content-Type", 776 | "value": "text/plain" 777 | } 778 | ], 779 | "cookie": [], 780 | "body": "" 781 | }, 782 | { 783 | "name": "Ugyldig scope", 784 | "originalRequest": { 785 | "method": "PUT", 786 | "header": [], 787 | "url": { 788 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 789 | "host": [ 790 | "{{baseUrl}}" 791 | ], 792 | "path": [ 793 | "delegationSchemes", 794 | "", 795 | "scopes", 796 | ":scope" 797 | ], 798 | "variable": [ 799 | { 800 | "key": "scope" 801 | } 802 | ] 803 | } 804 | }, 805 | "status": "Bad Request", 806 | "code": 400, 807 | "_postman_previewlanguage": "text", 808 | "header": [ 809 | { 810 | "key": "Content-Type", 811 | "value": "text/plain" 812 | } 813 | ], 814 | "cookie": [], 815 | "body": "" 816 | } 817 | ] 818 | }, 819 | { 820 | "name": "Erstatt eksisterende liste av scopes med ny liste med scopes", 821 | "request": { 822 | "method": "PUT", 823 | "header": [ 824 | { 825 | "key": "Content-Type", 826 | "value": "application/json" 827 | } 828 | ], 829 | "body": { 830 | "mode": "raw", 831 | "raw": "[\r\n \"altinn:serviceowner/authorization\",\r\n \"altinn:serviceowner/organizations\",\r\n \"altinn:serviceowner/events\"\r\n]" 832 | }, 833 | "url": { 834 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId/scopes", 835 | "host": [ 836 | "{{baseUrl}}" 837 | ], 838 | "path": [ 839 | "delegationSchemes", 840 | ":delegationSchemeId", 841 | "scopes" 842 | ], 843 | "variable": [ 844 | { 845 | "description": "ID for delegeringsoppsett", 846 | "key": "delegationSchemeId", 847 | "value": "{{DefaultDelegationSchemeId}}" 848 | } 849 | ] 850 | } 851 | }, 852 | "response": [ 853 | { 854 | "name": "Ugyldig liste med scopes", 855 | "originalRequest": { 856 | "method": "PUT", 857 | "header": [ 858 | { 859 | "key": "Content-Type", 860 | "value": "application/json" 861 | } 862 | ], 863 | "body": { 864 | "mode": "raw", 865 | "raw": "[\n \"\",\n \"\"\n]" 866 | }, 867 | "url": { 868 | "raw": "{{baseUrl}}/delegationSchemes//scopes", 869 | "host": [ 870 | "{{baseUrl}}" 871 | ], 872 | "path": [ 873 | "delegationSchemes", 874 | "", 875 | "scopes" 876 | ] 877 | } 878 | }, 879 | "status": "Bad Request", 880 | "code": 400, 881 | "_postman_previewlanguage": "json", 882 | "header": [ 883 | { 884 | "key": "Content-Type", 885 | "value": "application/json" 886 | } 887 | ], 888 | "cookie": [], 889 | "body": "{\n \"error_description\": \"\",\n \"error_code\": \"\"\n}" 890 | }, 891 | { 892 | "name": "Listen med scopes ble oppdatert", 893 | "originalRequest": { 894 | "method": "PUT", 895 | "header": [ 896 | { 897 | "key": "Content-Type", 898 | "value": "application/json" 899 | } 900 | ], 901 | "body": { 902 | "mode": "raw", 903 | "raw": "[\n \"\",\n \"\"\n]" 904 | }, 905 | "url": { 906 | "raw": "{{baseUrl}}/delegationSchemes//scopes", 907 | "host": [ 908 | "{{baseUrl}}" 909 | ], 910 | "path": [ 911 | "delegationSchemes", 912 | "", 913 | "scopes" 914 | ] 915 | } 916 | }, 917 | "status": "No Content", 918 | "code": 204, 919 | "_postman_previewlanguage": "text", 920 | "header": [ 921 | { 922 | "key": "Content-Type", 923 | "value": "text/plain" 924 | } 925 | ], 926 | "cookie": [], 927 | "body": "" 928 | }, 929 | { 930 | "name": "Ikke tilgang til å oppdatere oppgitt delegeringsoppsett.", 931 | "originalRequest": { 932 | "method": "PUT", 933 | "header": [ 934 | { 935 | "key": "Content-Type", 936 | "value": "application/json" 937 | } 938 | ], 939 | "body": { 940 | "mode": "raw", 941 | "raw": "[\n \"\",\n \"\"\n]" 942 | }, 943 | "url": { 944 | "raw": "{{baseUrl}}/delegationSchemes//scopes", 945 | "host": [ 946 | "{{baseUrl}}" 947 | ], 948 | "path": [ 949 | "delegationSchemes", 950 | "", 951 | "scopes" 952 | ] 953 | } 954 | }, 955 | "status": "Forbidden", 956 | "code": 403, 957 | "_postman_previewlanguage": "text", 958 | "header": [ 959 | { 960 | "key": "Content-Type", 961 | "value": "text/plain" 962 | } 963 | ], 964 | "cookie": [], 965 | "body": "" 966 | } 967 | ] 968 | }, 969 | { 970 | "name": "Slett oppgitt scope fra liste av scopes for oppgitt delegeringsoppsett", 971 | "request": { 972 | "method": "DELETE", 973 | "header": [], 974 | "url": { 975 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId/scopes/?scope=altinn:serviceowner/events", 976 | "host": [ 977 | "{{baseUrl}}" 978 | ], 979 | "path": [ 980 | "delegationSchemes", 981 | ":delegationSchemeId", 982 | "scopes", 983 | "" 984 | ], 985 | "query": [ 986 | { 987 | "key": "scope", 988 | "value": "altinn:serviceowner/events" 989 | } 990 | ], 991 | "variable": [ 992 | { 993 | "description": "ID for delegeringsoppsett", 994 | "key": "delegationSchemeId", 995 | "value": "{{DefaultDelegationSchemeId}}" 996 | } 997 | ] 998 | } 999 | }, 1000 | "response": [ 1001 | { 1002 | "name": "Oppgitt scope ikke funnet i listen av scopes for gitt delegeringsoppsett", 1003 | "originalRequest": { 1004 | "method": "DELETE", 1005 | "header": [], 1006 | "url": { 1007 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 1008 | "host": [ 1009 | "{{baseUrl}}" 1010 | ], 1011 | "path": [ 1012 | "delegationSchemes", 1013 | "", 1014 | "scopes", 1015 | ":scope" 1016 | ], 1017 | "variable": [ 1018 | { 1019 | "key": "scope" 1020 | } 1021 | ] 1022 | } 1023 | }, 1024 | "status": "Not Found", 1025 | "code": 404, 1026 | "_postman_previewlanguage": "text", 1027 | "header": [ 1028 | { 1029 | "key": "Content-Type", 1030 | "value": "text/plain" 1031 | } 1032 | ], 1033 | "cookie": [], 1034 | "body": "" 1035 | }, 1036 | { 1037 | "name": "Ikke tilgang til å slette scope fra oppgitt delegeringsoppsett.", 1038 | "originalRequest": { 1039 | "method": "DELETE", 1040 | "header": [], 1041 | "url": { 1042 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 1043 | "host": [ 1044 | "{{baseUrl}}" 1045 | ], 1046 | "path": [ 1047 | "delegationSchemes", 1048 | "", 1049 | "scopes", 1050 | ":scope" 1051 | ], 1052 | "variable": [ 1053 | { 1054 | "key": "scope" 1055 | } 1056 | ] 1057 | } 1058 | }, 1059 | "status": "Forbidden", 1060 | "code": 403, 1061 | "_postman_previewlanguage": "text", 1062 | "header": [ 1063 | { 1064 | "key": "Content-Type", 1065 | "value": "text/plain" 1066 | } 1067 | ], 1068 | "cookie": [], 1069 | "body": "" 1070 | }, 1071 | { 1072 | "name": "Scope fjernet fra listen", 1073 | "originalRequest": { 1074 | "method": "DELETE", 1075 | "header": [], 1076 | "url": { 1077 | "raw": "{{baseUrl}}/delegationSchemes//scopes/:scope", 1078 | "host": [ 1079 | "{{baseUrl}}" 1080 | ], 1081 | "path": [ 1082 | "delegationSchemes", 1083 | "", 1084 | "scopes", 1085 | ":scope" 1086 | ], 1087 | "variable": [ 1088 | { 1089 | "key": "scope" 1090 | } 1091 | ] 1092 | } 1093 | }, 1094 | "status": "No Content", 1095 | "code": 204, 1096 | "_postman_previewlanguage": "text", 1097 | "header": [ 1098 | { 1099 | "key": "Content-Type", 1100 | "value": "text/plain" 1101 | } 1102 | ], 1103 | "cookie": [], 1104 | "body": "" 1105 | } 1106 | ] 1107 | } 1108 | ], 1109 | "event": [ 1110 | { 1111 | "listen": "prerequest", 1112 | "script": { 1113 | "id": "1d792813-9240-406e-b87a-9b66b08d34bb", 1114 | "type": "text/javascript", 1115 | "exec": [ 1116 | "" 1117 | ] 1118 | } 1119 | }, 1120 | { 1121 | "listen": "test", 1122 | "script": { 1123 | "id": "8085287c-d866-48ac-93fc-4f0aed0af719", 1124 | "type": "text/javascript", 1125 | "exec": [ 1126 | "" 1127 | ] 1128 | } 1129 | } 1130 | ], 1131 | "protocolProfileBehavior": {}, 1132 | "_postman_isSubFolder": true 1133 | }, 1134 | { 1135 | "name": "Hent et delegeringsoppsett", 1136 | "event": [ 1137 | { 1138 | "listen": "test", 1139 | "script": { 1140 | "id": "bfb7fd8e-7eba-4d86-9827-75aef7276468", 1141 | "exec": [ 1142 | "pm.test(\"Status code is 200\", function () {", 1143 | " pm.response.to.have.status(200);", 1144 | "});", 1145 | "", 1146 | "pm.test(\"Returns the correct DS\", function () {", 1147 | " var jsonData = pm.response.json();", 1148 | " pm.expect(jsonData.delegation_scheme_id).to.eql(pm.environment.get(\"DefaultDelegationSchemeId\"));", 1149 | "});" 1150 | ], 1151 | "type": "text/javascript" 1152 | } 1153 | } 1154 | ], 1155 | "request": { 1156 | "method": "GET", 1157 | "header": [], 1158 | "url": { 1159 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId", 1160 | "host": [ 1161 | "{{baseUrl}}" 1162 | ], 1163 | "path": [ 1164 | "delegationSchemes", 1165 | ":delegationSchemeId" 1166 | ], 1167 | "variable": [ 1168 | { 1169 | "key": "delegationSchemeId", 1170 | "value": "{{DefaultDelegationSchemeId}}" 1171 | } 1172 | ] 1173 | }, 1174 | "description": "Hent informasjon om et enkelt delegeringsoppsett." 1175 | }, 1176 | "response": [ 1177 | { 1178 | "name": "Returnerer et delegeringsoppsett som definert av `DelegationScheme`.", 1179 | "originalRequest": { 1180 | "method": "GET", 1181 | "header": [], 1182 | "url": { 1183 | "raw": "{{baseUrl}}/delegationSchemes/", 1184 | "host": [ 1185 | "{{baseUrl}}" 1186 | ], 1187 | "path": [ 1188 | "delegationSchemes", 1189 | "" 1190 | ] 1191 | } 1192 | }, 1193 | "status": "OK", 1194 | "code": 200, 1195 | "_postman_previewlanguage": "json", 1196 | "header": [ 1197 | { 1198 | "key": "Content-Type", 1199 | "value": "application/json" 1200 | } 1201 | ], 1202 | "cookie": [], 1203 | "body": "{\n \"scopes\": [\n \"\",\n \"\"\n ],\n \"title\": [\n {\n \"code\": \"\",\n \"value\": \"\"\n },\n {\n \"code\": \"\",\n \"value\": \"\"\n }\n ],\n \"description\": [\n {\n \"code\": \"\",\n \"value\": \"\"\n },\n {\n \"code\": \"\",\n \"value\": \"\"\n }\n ],\n \"delegation_source\": \"\",\n \"delegation_scheme_id\": \"\",\n \"owner_org\": \"\",\n \"default_language\": \"\",\n \"delegation_source_config\": [\n {\n \"key\": \"\",\n \"value\": \"\"\n },\n {\n \"key\": \"\",\n \"value\": \"\"\n }\n ],\n \"created\": \"\",\n \"last_changed\": \"\"\n}" 1204 | }, 1205 | { 1206 | "name": "Ikke tilgang til å hente oppgitt delegeringsoppsett.", 1207 | "originalRequest": { 1208 | "method": "GET", 1209 | "header": [], 1210 | "url": { 1211 | "raw": "{{baseUrl}}/delegationSchemes/", 1212 | "host": [ 1213 | "{{baseUrl}}" 1214 | ], 1215 | "path": [ 1216 | "delegationSchemes", 1217 | "" 1218 | ] 1219 | } 1220 | }, 1221 | "status": "Forbidden", 1222 | "code": 403, 1223 | "_postman_previewlanguage": "text", 1224 | "header": [ 1225 | { 1226 | "key": "Content-Type", 1227 | "value": "text/plain" 1228 | } 1229 | ], 1230 | "cookie": [], 1231 | "body": "" 1232 | }, 1233 | { 1234 | "name": "Forespurte delegeringsoppsett ble ikke funnet.", 1235 | "originalRequest": { 1236 | "method": "GET", 1237 | "header": [], 1238 | "url": { 1239 | "raw": "{{baseUrl}}/delegationSchemes/", 1240 | "host": [ 1241 | "{{baseUrl}}" 1242 | ], 1243 | "path": [ 1244 | "delegationSchemes", 1245 | "" 1246 | ] 1247 | } 1248 | }, 1249 | "status": "Not Found", 1250 | "code": 404, 1251 | "_postman_previewlanguage": "text", 1252 | "header": [ 1253 | { 1254 | "key": "Content-Type", 1255 | "value": "text/plain" 1256 | } 1257 | ], 1258 | "cookie": [], 1259 | "body": "" 1260 | } 1261 | ] 1262 | }, 1263 | { 1264 | "name": "Oppdaterer et delegeringsoppsett", 1265 | "event": [ 1266 | { 1267 | "listen": "test", 1268 | "script": { 1269 | "id": "39703a7a-9f5b-4ff9-a6ca-b52c88e7697c", 1270 | "exec": [ 1271 | "pm.test(\"Status code is 501\", function () {", 1272 | " pm.response.to.have.status(501);", 1273 | "});" 1274 | ], 1275 | "type": "text/javascript" 1276 | } 1277 | } 1278 | ], 1279 | "request": { 1280 | "method": "PUT", 1281 | "header": [ 1282 | { 1283 | "key": "Content-Type", 1284 | "value": "application/json" 1285 | } 1286 | ], 1287 | "body": { 1288 | "mode": "raw", 1289 | "raw": "{\n \"owner_org\": \"{{DefaultOwnerOrgNo}}\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 1290 | }, 1291 | "url": { 1292 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId", 1293 | "host": [ 1294 | "{{baseUrl}}" 1295 | ], 1296 | "path": [ 1297 | "delegationSchemes", 1298 | ":delegationSchemeId" 1299 | ], 1300 | "variable": [ 1301 | { 1302 | "key": "delegationSchemeId", 1303 | "value": "{{DefaultDelegationSchemeId}}", 1304 | "description": "ID for delegeringsoppsett" 1305 | } 1306 | ] 1307 | }, 1308 | "description": "Oppdaterer et delegeringsoppsett." 1309 | }, 1310 | "response": [ 1311 | { 1312 | "name": "Forespurte delegeringsoppsett ble ikke funnet.", 1313 | "originalRequest": { 1314 | "method": "PUT", 1315 | "header": [ 1316 | { 1317 | "key": "Content-Type", 1318 | "value": "application/json" 1319 | } 1320 | ], 1321 | "body": { 1322 | "mode": "raw", 1323 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 1324 | }, 1325 | "url": { 1326 | "raw": "{{baseUrl}}/delegationSchemes/", 1327 | "host": [ 1328 | "{{baseUrl}}" 1329 | ], 1330 | "path": [ 1331 | "delegationSchemes", 1332 | "" 1333 | ] 1334 | } 1335 | }, 1336 | "status": "Not Found", 1337 | "code": 404, 1338 | "_postman_previewlanguage": "text", 1339 | "header": [ 1340 | { 1341 | "key": "Content-Type", 1342 | "value": "text/plain" 1343 | } 1344 | ], 1345 | "cookie": [], 1346 | "body": "" 1347 | }, 1348 | { 1349 | "name": "Delegeringsoppsettet ble oppdatert.", 1350 | "originalRequest": { 1351 | "method": "PUT", 1352 | "header": [ 1353 | { 1354 | "key": "Content-Type", 1355 | "value": "application/json" 1356 | } 1357 | ], 1358 | "body": { 1359 | "mode": "raw", 1360 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 1361 | }, 1362 | "url": { 1363 | "raw": "{{baseUrl}}/delegationSchemes/", 1364 | "host": [ 1365 | "{{baseUrl}}" 1366 | ], 1367 | "path": [ 1368 | "delegationSchemes", 1369 | "" 1370 | ] 1371 | } 1372 | }, 1373 | "status": "Accepted", 1374 | "code": 202, 1375 | "_postman_previewlanguage": "text", 1376 | "header": [ 1377 | { 1378 | "key": "Content-Type", 1379 | "value": "text/plain" 1380 | } 1381 | ], 1382 | "cookie": [], 1383 | "body": "" 1384 | }, 1385 | { 1386 | "name": "Ikke tilgang til å oppdatere delegeringsoppsettet. Nærmere forklaring ligger i response body.", 1387 | "originalRequest": { 1388 | "method": "PUT", 1389 | "header": [ 1390 | { 1391 | "key": "Content-Type", 1392 | "value": "application/json" 1393 | } 1394 | ], 1395 | "body": { 1396 | "mode": "raw", 1397 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 1398 | }, 1399 | "url": { 1400 | "raw": "{{baseUrl}}/delegationSchemes/", 1401 | "host": [ 1402 | "{{baseUrl}}" 1403 | ], 1404 | "path": [ 1405 | "delegationSchemes", 1406 | "" 1407 | ] 1408 | } 1409 | }, 1410 | "status": "Forbidden", 1411 | "code": 403, 1412 | "_postman_previewlanguage": "json", 1413 | "header": [ 1414 | { 1415 | "key": "Content-Type", 1416 | "value": "application/json" 1417 | } 1418 | ], 1419 | "cookie": [], 1420 | "body": "{\n \"error_description\": \"\",\n \"error_code\": \"\"\n}" 1421 | }, 1422 | { 1423 | "name": "Ugyldig delegeringsoppsett. Se respons for nærmere forklaring.", 1424 | "originalRequest": { 1425 | "method": "PUT", 1426 | "header": [ 1427 | { 1428 | "key": "Content-Type", 1429 | "value": "application/json" 1430 | } 1431 | ], 1432 | "body": { 1433 | "mode": "raw", 1434 | "raw": "{\n \"owner_org\": \"991825827\",\n \"scopes\": [\n \"difi:user/kontaktinfo.read\",\n \"difi:user/varsling.read\"\n ],\n \"default_language\": \"nb_NO\",\n \"title\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Full tilgang til Kontakt- og Reservasjonsregisteret\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Full access to the Contact and Reservation Register\"\n }\n ],\n \"description\": [\n {\n \"code\": \"nb_NO\",\n \"value\": \"Gir anledning til å lese og endre data i KRR\"\n },\n {\n \"code\": \"nn_NO\",\n \"value\": \"Gjer høve til å lesa og endra data i KRR\"\n },\n {\n \"code\": \"en_GB\",\n \"value\": \"Allows you to read and change data in the Contact and Reservation Register\"\n }\n ],\n \"delegation_source\": \"altinn\",\n \"delegation_source_config\": [\n {\n \"key\": \"RequiresRoles\",\n \"value\": \"DAGL,LEDE\"\n }\n ]\n}" 1435 | }, 1436 | "url": { 1437 | "raw": "{{baseUrl}}/delegationSchemes/", 1438 | "host": [ 1439 | "{{baseUrl}}" 1440 | ], 1441 | "path": [ 1442 | "delegationSchemes", 1443 | "" 1444 | ] 1445 | } 1446 | }, 1447 | "status": "Bad Request", 1448 | "code": 400, 1449 | "_postman_previewlanguage": "json", 1450 | "header": [ 1451 | { 1452 | "key": "Content-Type", 1453 | "value": "application/json" 1454 | } 1455 | ], 1456 | "cookie": [], 1457 | "body": "{\n \"error_description\": \"\",\n \"error_code\": \"\"\n}" 1458 | } 1459 | ] 1460 | }, 1461 | { 1462 | "name": "Slett et delegeringsoppsett", 1463 | "event": [ 1464 | { 1465 | "listen": "test", 1466 | "script": { 1467 | "id": "a2a258e1-f964-4d95-b435-392a7e0915bc", 1468 | "exec": [ 1469 | "pm.test(\"Status code is 204\", function () {", 1470 | " pm.response.to.have.status(204);", 1471 | "});" 1472 | ], 1473 | "type": "text/javascript" 1474 | } 1475 | } 1476 | ], 1477 | "request": { 1478 | "method": "DELETE", 1479 | "header": [], 1480 | "url": { 1481 | "raw": "{{baseUrl}}/delegationSchemes/:delegationSchemeId", 1482 | "host": [ 1483 | "{{baseUrl}}" 1484 | ], 1485 | "path": [ 1486 | "delegationSchemes", 1487 | ":delegationSchemeId" 1488 | ], 1489 | "variable": [ 1490 | { 1491 | "key": "delegationSchemeId", 1492 | "value": "{{DefaultDelegationSchemeId}}", 1493 | "description": "ID for delegeringsoppsett" 1494 | } 1495 | ] 1496 | }, 1497 | "description": "Sletter et eksisterende delegeringsoppsett, hvis delegeringsskilden tillater det." 1498 | }, 1499 | "response": [ 1500 | { 1501 | "name": "Oppsettet ble slettet.", 1502 | "originalRequest": { 1503 | "method": "DELETE", 1504 | "header": [], 1505 | "url": { 1506 | "raw": "{{baseUrl}}/delegationSchemes/", 1507 | "host": [ 1508 | "{{baseUrl}}" 1509 | ], 1510 | "path": [ 1511 | "delegationSchemes", 1512 | "" 1513 | ] 1514 | } 1515 | }, 1516 | "status": "No Content", 1517 | "code": 204, 1518 | "_postman_previewlanguage": "text", 1519 | "header": [ 1520 | { 1521 | "key": "Content-Type", 1522 | "value": "text/plain" 1523 | } 1524 | ], 1525 | "cookie": [], 1526 | "body": "" 1527 | }, 1528 | { 1529 | "name": "Kunne ikke slette delegeringsoppsettet. Nærmere forklaring ligger i response body.", 1530 | "originalRequest": { 1531 | "method": "DELETE", 1532 | "header": [], 1533 | "url": { 1534 | "raw": "{{baseUrl}}/delegationSchemes/", 1535 | "host": [ 1536 | "{{baseUrl}}" 1537 | ], 1538 | "path": [ 1539 | "delegationSchemes", 1540 | "" 1541 | ] 1542 | } 1543 | }, 1544 | "status": "Forbidden", 1545 | "code": 403, 1546 | "_postman_previewlanguage": "json", 1547 | "header": [ 1548 | { 1549 | "key": "Content-Type", 1550 | "value": "application/json" 1551 | } 1552 | ], 1553 | "cookie": [], 1554 | "body": "{\n \"error_description\": \"\",\n \"error_code\": \"\"\n}" 1555 | }, 1556 | { 1557 | "name": "Forespurte delegeringsoppsett ble ikke funnet.", 1558 | "originalRequest": { 1559 | "method": "DELETE", 1560 | "header": [], 1561 | "url": { 1562 | "raw": "{{baseUrl}}/delegationSchemes/", 1563 | "host": [ 1564 | "{{baseUrl}}" 1565 | ], 1566 | "path": [ 1567 | "delegationSchemes", 1568 | "" 1569 | ] 1570 | } 1571 | }, 1572 | "status": "Not Found", 1573 | "code": 404, 1574 | "_postman_previewlanguage": "text", 1575 | "header": [ 1576 | { 1577 | "key": "Content-Type", 1578 | "value": "text/plain" 1579 | } 1580 | ], 1581 | "cookie": [], 1582 | "body": "" 1583 | } 1584 | ] 1585 | } 1586 | ], 1587 | "event": [ 1588 | { 1589 | "listen": "prerequest", 1590 | "script": { 1591 | "id": "f9eda62f-de85-46da-b7ba-7cc99b3b82b2", 1592 | "type": "text/javascript", 1593 | "exec": [ 1594 | "" 1595 | ] 1596 | } 1597 | }, 1598 | { 1599 | "listen": "test", 1600 | "script": { 1601 | "id": "338fee27-a241-4c25-acb5-9bcf97d12130", 1602 | "type": "text/javascript", 1603 | "exec": [ 1604 | "" 1605 | ] 1606 | } 1607 | } 1608 | ], 1609 | "protocolProfileBehavior": {}, 1610 | "_postman_isSubFolder": true 1611 | } 1612 | ], 1613 | "event": [ 1614 | { 1615 | "listen": "prerequest", 1616 | "script": { 1617 | "id": "22158a81-bd21-4de2-9bd1-a08314f1dd23", 1618 | "type": "text/javascript", 1619 | "exec": [ 1620 | "" 1621 | ] 1622 | } 1623 | }, 1624 | { 1625 | "listen": "test", 1626 | "script": { 1627 | "id": "1fa7e83b-27eb-481d-b2cd-5b93632ba5f5", 1628 | "type": "text/javascript", 1629 | "exec": [ 1630 | "" 1631 | ] 1632 | } 1633 | } 1634 | ], 1635 | "protocolProfileBehavior": {} 1636 | }, 1637 | { 1638 | "name": "Delegations", 1639 | "item": [ 1640 | { 1641 | "name": "Liste over delegeringer som er gjort på et scope", 1642 | "event": [ 1643 | { 1644 | "listen": "prerequest", 1645 | "script": { 1646 | "id": "2166884a-7138-439b-8732-5882e22f95ff", 1647 | "exec": [ 1648 | "" 1649 | ], 1650 | "type": "text/javascript" 1651 | } 1652 | } 1653 | ], 1654 | "request": { 1655 | "method": "GET", 1656 | "header": [], 1657 | "url": { 1658 | "raw": "{{baseUrl}}/delegations?scope=altinn:maskinporten/anisha.read", 1659 | "host": [ 1660 | "{{baseUrl}}" 1661 | ], 1662 | "path": [ 1663 | "delegations" 1664 | ], 1665 | "query": [ 1666 | { 1667 | "key": "scope", 1668 | "value": "{{DefaultScope}}", 1669 | "disabled": true 1670 | }, 1671 | { 1672 | "key": "scope", 1673 | "value": "altinn:ettellerannetscope.read", 1674 | "disabled": true 1675 | }, 1676 | { 1677 | "key": "scope", 1678 | "value": "altinn:maskinporten/anisha.read" 1679 | } 1680 | ] 1681 | } 1682 | }, 1683 | "response": [ 1684 | { 1685 | "name": "Liste over alle delegeringer som er gjort på dette scopet.", 1686 | "originalRequest": { 1687 | "method": "GET", 1688 | "header": [], 1689 | "url": { 1690 | "raw": "{{baseUrl}}/delegations?scope={\"value\":\"reference #/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=", 1691 | "host": [ 1692 | "{{baseUrl}}" 1693 | ], 1694 | "path": [ 1695 | "delegations" 1696 | ], 1697 | "query": [ 1698 | { 1699 | "key": "scope", 1700 | "value": "{\"value\":\"reference " 1701 | } 1702 | ], 1703 | "hash": "/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=" 1704 | } 1705 | }, 1706 | "status": "OK", 1707 | "code": 200, 1708 | "_postman_previewlanguage": "json", 1709 | "header": [ 1710 | { 1711 | "key": "Content-Type", 1712 | "value": "application/json" 1713 | } 1714 | ], 1715 | "cookie": [], 1716 | "body": "[\n {\n \"consumer_org\": \"\",\n \"supplier_org\": \"\",\n \"delegation_scheme_id\": \"\",\n \"created\": \"\",\n \"scopes\": [\n \"\",\n \"\"\n ]\n },\n {\n \"consumer_org\": \"\",\n \"supplier_org\": \"\",\n \"delegation_scheme_id\": \"\",\n \"created\": \"\",\n \"scopes\": [\n \"\",\n \"\"\n ]\n }\n]" 1717 | }, 1718 | { 1719 | "name": "Ikke tilgang til å hente ut delegeringer", 1720 | "originalRequest": { 1721 | "method": "GET", 1722 | "header": [], 1723 | "url": { 1724 | "raw": "{{baseUrl}}/delegations?scope={\"value\":\"reference #/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=", 1725 | "host": [ 1726 | "{{baseUrl}}" 1727 | ], 1728 | "path": [ 1729 | "delegations" 1730 | ], 1731 | "query": [ 1732 | { 1733 | "key": "scope", 1734 | "value": "{\"value\":\"reference " 1735 | } 1736 | ], 1737 | "hash": "/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=" 1738 | } 1739 | }, 1740 | "status": "Forbidden", 1741 | "code": 403, 1742 | "_postman_previewlanguage": "text", 1743 | "header": [ 1744 | { 1745 | "key": "Content-Type", 1746 | "value": "text/plain" 1747 | } 1748 | ], 1749 | "cookie": [], 1750 | "body": "" 1751 | } 1752 | ] 1753 | }, 1754 | { 1755 | "name": "Liste over delegeringer som er gjort på et scope mellom to parter", 1756 | "event": [ 1757 | { 1758 | "listen": "prerequest", 1759 | "script": { 1760 | "id": "2166884a-7138-439b-8732-5882e22f95ff", 1761 | "exec": [ 1762 | "" 1763 | ], 1764 | "type": "text/javascript" 1765 | } 1766 | } 1767 | ], 1768 | "request": { 1769 | "method": "GET", 1770 | "header": [], 1771 | "url": { 1772 | "raw": "{{baseUrl}}/delegations?", 1773 | "host": [ 1774 | "{{baseUrl}}" 1775 | ], 1776 | "path": [ 1777 | "delegations" 1778 | ], 1779 | "query": [ 1780 | { 1781 | "key": "scope", 1782 | "value": "{{DefaultScope}}", 1783 | "disabled": true 1784 | }, 1785 | { 1786 | "key": "consumerOrg", 1787 | "value": "{{DefaultConsumerOrg}}", 1788 | "disabled": true 1789 | }, 1790 | { 1791 | "key": "supplierOrg", 1792 | "value": "{{DefaultSupplierOrg}}", 1793 | "disabled": true 1794 | } 1795 | ] 1796 | } 1797 | }, 1798 | "response": [ 1799 | { 1800 | "name": "Liste over alle delegeringer som er gjort på dette scopet.", 1801 | "originalRequest": { 1802 | "method": "GET", 1803 | "header": [], 1804 | "url": { 1805 | "raw": "{{baseUrl}}/delegations?scope={\"value\":\"reference #/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=", 1806 | "host": [ 1807 | "{{baseUrl}}" 1808 | ], 1809 | "path": [ 1810 | "delegations" 1811 | ], 1812 | "query": [ 1813 | { 1814 | "key": "scope", 1815 | "value": "{\"value\":\"reference " 1816 | } 1817 | ], 1818 | "hash": "/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=" 1819 | } 1820 | }, 1821 | "status": "OK", 1822 | "code": 200, 1823 | "_postman_previewlanguage": "json", 1824 | "header": [ 1825 | { 1826 | "key": "Content-Type", 1827 | "value": "application/json" 1828 | } 1829 | ], 1830 | "cookie": [], 1831 | "body": "[\n {\n \"consumer_org\": \"\",\n \"supplier_org\": \"\",\n \"delegation_scheme_id\": \"\",\n \"created\": \"\",\n \"scopes\": [\n \"\",\n \"\"\n ]\n },\n {\n \"consumer_org\": \"\",\n \"supplier_org\": \"\",\n \"delegation_scheme_id\": \"\",\n \"created\": \"\",\n \"scopes\": [\n \"\",\n \"\"\n ]\n }\n]" 1832 | }, 1833 | { 1834 | "name": "Ikke tilgang til å hente ut delegeringer", 1835 | "originalRequest": { 1836 | "method": "GET", 1837 | "header": [], 1838 | "url": { 1839 | "raw": "{{baseUrl}}/delegations?scope={\"value\":\"reference #/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=", 1840 | "host": [ 1841 | "{{baseUrl}}" 1842 | ], 1843 | "path": [ 1844 | "delegations" 1845 | ], 1846 | "query": [ 1847 | { 1848 | "key": "scope", 1849 | "value": "{\"value\":\"reference " 1850 | } 1851 | ], 1852 | "hash": "/components/schemas/Scope not found in the api spec\"}&consumer_org=&supplier_org=" 1853 | } 1854 | }, 1855 | "status": "Forbidden", 1856 | "code": 403, 1857 | "_postman_previewlanguage": "text", 1858 | "header": [ 1859 | { 1860 | "key": "Content-Type", 1861 | "value": "text/plain" 1862 | } 1863 | ], 1864 | "cookie": [], 1865 | "body": "" 1866 | } 1867 | ] 1868 | } 1869 | ], 1870 | "protocolProfileBehavior": {} 1871 | }, 1872 | { 1873 | "name": "Test operations", 1874 | "item": [ 1875 | { 1876 | "name": "authtest1", 1877 | "event": [ 1878 | { 1879 | "listen": "test", 1880 | "script": { 1881 | "id": "b28bb68b-c9ed-4b3a-8ecf-31c869f6b807", 1882 | "exec": [ 1883 | "pm.test(\"Status code is 200\", function () {", 1884 | " pm.response.to.have.status(200);", 1885 | "});" 1886 | ], 1887 | "type": "text/javascript" 1888 | } 1889 | } 1890 | ], 1891 | "request": { 1892 | "method": "GET", 1893 | "header": [], 1894 | "url": { 1895 | "raw": "{{baseUrl}}/authtest1", 1896 | "host": [ 1897 | "{{baseUrl}}" 1898 | ], 1899 | "path": [ 1900 | "authtest1" 1901 | ] 1902 | } 1903 | }, 1904 | "response": [] 1905 | }, 1906 | { 1907 | "name": "authtest2", 1908 | "event": [ 1909 | { 1910 | "listen": "test", 1911 | "script": { 1912 | "id": "71d0628b-d085-4f40-8612-e916659cd5d7", 1913 | "exec": [ 1914 | "pm.test(\"Status code is 200\", function () {", 1915 | " pm.response.to.have.status(200);", 1916 | "});" 1917 | ], 1918 | "type": "text/javascript" 1919 | } 1920 | } 1921 | ], 1922 | "request": { 1923 | "method": "GET", 1924 | "header": [], 1925 | "url": { 1926 | "raw": "{{baseUrl}}/authtest2", 1927 | "host": [ 1928 | "{{baseUrl}}" 1929 | ], 1930 | "path": [ 1931 | "authtest2" 1932 | ] 1933 | } 1934 | }, 1935 | "response": [] 1936 | } 1937 | ], 1938 | "protocolProfileBehavior": {} 1939 | } 1940 | ], 1941 | "auth": { 1942 | "type": "bearer", 1943 | "bearer": [ 1944 | { 1945 | "key": "token", 1946 | "value": "{{accessToken}}", 1947 | "type": "string" 1948 | } 1949 | ] 1950 | }, 1951 | "event": [ 1952 | { 1953 | "listen": "prerequest", 1954 | "script": { 1955 | "id": "2a79582c-1a4a-4585-96a7-d9710a82d01c", 1956 | "type": "text/javascript", 1957 | "exec": [ 1958 | "var accessToken = pm.environment.get(\"accessToken\");", 1959 | "var accesTokenExpires = pm.environment.get(\"accesTokenExpires\");", 1960 | "var accesTokenExpires = pm.environment.get(\"accesTokenExpires\");", 1961 | "var alwaysRefresh = pm.environment.get('alwaysRefreshToken') === 'true';", 1962 | "", 1963 | "if (alwaysRefresh || !accessToken || !accesTokenExpires || new Date() > new Date(accesTokenExpires)) {", 1964 | " console.log(\"Access token not set or expired.\");", 1965 | " console.log(\"Token set? \" + (accessToken ? 'Yes' : 'No'));", 1966 | " console.log(\"Expires set? \" + (accesTokenExpires ? 'Yes, ' + accesTokenExpires : 'No'));", 1967 | " console.log(\"Always refresh? \" + (alwaysRefresh ? 'Yes' : 'No'));", 1968 | " ", 1969 | " pm.sendRequest(\"http://localhost:17823/\", function (err, response) {", 1970 | " var json = response.json();", 1971 | " if (typeof json.access_token !== \"undefined\") {", 1972 | " pm.environment.set(\"accessToken\", json.access_token);", 1973 | " pm.environment.set(\"scopes\", json.scope);", 1974 | " pm.environment.set(\"accesTokenExpires\", new Date((new Date()).getTime() + parseInt(json.expires_in + \"000\")).toUTCString());", 1975 | " console.log(\"New access token received, expires \" + pm.environment.get(\"accesTokenExpires\"));", 1976 | " console.log(\"Scopes: \" + json.scope);", 1977 | " }", 1978 | " else {", 1979 | " console.error(\"Failed getting token\", json);", 1980 | " }", 1981 | " });", 1982 | "}", 1983 | "else {", 1984 | " console.log(\"Access token still valid until \" + accesTokenExpires);", 1985 | "}", 1986 | "" 1987 | ] 1988 | } 1989 | }, 1990 | { 1991 | "listen": "test", 1992 | "script": { 1993 | "id": "a477b3c2-f7f1-4bf1-a398-f08c0e4deba3", 1994 | "type": "text/javascript", 1995 | "exec": [ 1996 | "" 1997 | ] 1998 | } 1999 | } 2000 | ], 2001 | "protocolProfileBehavior": {} 2002 | } --------------------------------------------------------------------------------