|
21 | 21 |
|
22 | 22 | import java.io.IOException; |
23 | 23 | import java.io.InputStream; |
| 24 | +import java.net.URI; |
24 | 25 | import java.security.Security; |
25 | 26 | import java.time.Duration; |
26 | 27 | import java.util.*; |
@@ -422,8 +423,24 @@ public void createManagedKubernetesOffering() throws Exception { |
422 | 423 | .productSpecCharacteristicValue( |
423 | 424 | List.of( |
424 | 425 | new CharacteristicValueSpecificationVO() |
425 | | - .value("Endpoint of the K8S service."))) |
426 | | - )); |
| 426 | + .value("Endpoint of the K8S service."))), |
| 427 | + new ProductSpecificationCharacteristicVO() |
| 428 | + .id("credentialsConfig") |
| 429 | + .name("Credentials Config for the Target Service") |
| 430 | + .valueType("credentialsConfiguration") |
| 431 | + .atSchemaLocation(URI.create("https://raw.githubusercontent.com/FIWARE/contract-management/refs/heads/main/schemas/credentials/credentialConfigCharacteristic.json")) |
| 432 | + .productSpecCharacteristicValue( |
| 433 | + List.of( |
| 434 | + new CharacteristicValueSpecificationVO() |
| 435 | + .value(Map.of( |
| 436 | + "credentialsType", "OperatorCredential", |
| 437 | + "claims", List.of( |
| 438 | + Map.of("name", "roles", |
| 439 | + "path", "$.roles[?(@.target==\\\"" + getDid(MPOperationsEnvironment.DID_PROVIDER_ADDRESS) + "\\\")].names[*]", |
| 440 | + "allowedValues", List.of("OPERATOR")))) |
| 441 | + ) |
| 442 | + )))); |
| 443 | + |
427 | 444 | RequestBody specificationRequestBody = RequestBody.create(OBJECT_MAPPER.writeValueAsString(pscVo), okhttp3.MediaType.parse(MediaType.APPLICATION_JSON)); |
428 | 445 | Request specificationRequest = new Request.Builder() |
429 | 446 | .post(specificationRequestBody) |
@@ -502,7 +519,23 @@ public void createReportsOffering() throws Exception { |
502 | 519 | .productSpecCharacteristicValue( |
503 | 520 | List.of( |
504 | 521 | new CharacteristicValueSpecificationVO() |
505 | | - .value("Endpoint of the reporting service."))) |
| 522 | + .value("Endpoint of the reporting service."))), |
| 523 | + new ProductSpecificationCharacteristicVO() |
| 524 | + .id("credentialsConfig") |
| 525 | + .name("Credentials Config for the Target Service") |
| 526 | + .valueType("credentialsConfiguration") |
| 527 | + .atSchemaLocation(URI.create("https://raw.githubusercontent.com/FIWARE/contract-management/refs/heads/main/schemas/credentials/credentialConfigCharacteristic.json")) |
| 528 | + .productSpecCharacteristicValue( |
| 529 | + List.of( |
| 530 | + new CharacteristicValueSpecificationVO() |
| 531 | + .value(Map.of( |
| 532 | + "credentialsType", "OperatorCredential", |
| 533 | + "claims", List.of( |
| 534 | + Map.of("name", "roles", |
| 535 | + "path", "$.roles[?(@.target==\\\"" + getDid(MPOperationsEnvironment.DID_PROVIDER_ADDRESS) + "\\\")].names[*]", |
| 536 | + "allowedValues", List.of("OPERATOR")))) |
| 537 | + ) |
| 538 | + )) |
506 | 539 | )); |
507 | 540 | RequestBody specificationRequestBody = RequestBody.create(OBJECT_MAPPER.writeValueAsString(pscVo), okhttp3.MediaType.parse(MediaType.APPLICATION_JSON)); |
508 | 541 | Request specificationRequest = new Request.Builder() |
@@ -787,7 +820,7 @@ public void createK8SCluster() throws Exception { |
787 | 820 |
|
788 | 821 | createdEntities.add("urn:ngsi-ld:K8SCluster:fancy-marketplace"); |
789 | 822 | } |
790 | | - |
| 823 | + |
791 | 824 | @Then("Fancy Marketplace' employee can access the EnergyReport.") |
792 | 825 | public void accessTheEnergyReport() throws Exception { |
793 | 826 | String accessToken = getAccessTokenForFancyMarketplace(USER_CREDENTIAL, DEFAULT_SCOPE, MPOperationsEnvironment.PROVIDER_API_ADDRESS); |
|
0 commit comments