diff --git a/api/src/modules/admin-regions/admin-regions.controller.ts b/api/src/modules/admin-regions/admin-regions.controller.ts index f00b0197e..bd3cde942 100644 --- a/api/src/modules/admin-regions/admin-regions.controller.ts +++ b/api/src/modules/admin-regions/admin-regions.controller.ts @@ -97,6 +97,29 @@ export class AdminRegionsController { return this.adminRegionsService.serialize(results); } + @ApiOperation({ + description: + 'Find all EUDR admin regions and return them in a tree format. Data in the "children" will recursively extend for the full depth of the tree', + }) + @ApiOkTreeResponse({ + treeNodeType: AdminRegion, + }) + @ApiUnauthorizedResponse() + @ApiForbiddenResponse() + @UseInterceptors(SetScenarioIdsInterceptor) + @Get('/trees/eudr') + async getTreesForEudr( + @Query(ValidationPipe) + adminRegionTreeOptions: GetAdminRegionTreeWithOptionsDto, + ): Promise { + const results: AdminRegion[] = await this.adminRegionsService.getTrees({ + ...adminRegionTreeOptions, + withSourcingLocations: true, + eudr: true, + }); + return this.adminRegionsService.serialize(results); + } + @ApiOperation({ description: 'Find all admin regions given a country and return data in a tree format. Data in the "children" will recursively extend for the full depth of the tree', diff --git a/infrastructure/base/modules/aws/eks/thumbprint.sh b/infrastructure/base/modules/aws/eks/thumbprint.sh index 10772d913..9f565c53c 100755 --- a/infrastructure/base/modules/aws/eks/thumbprint.sh +++ b/infrastructure/base/modules/aws/eks/thumbprint.sh @@ -1,5 +1,5 @@ #!/bin/bash -THUMBPRINT=$(echo | openssl s_client -servername oidc.eks.${1}.amazonaws.com -showcerts -connect oidc.eks.${1}.amazonaws.com:443 2>&- | tac | sed -n '/-----END CERTIFICATE-----/,/-----BEGIN CERTIFICATE-----/p; /-----BEGIN CERTIFICATE-----/q' | tac | openssl x509 -fingerprint -noout | sed 's/://g' | awk -F= '{print tolower($2)}') +THUMBPRINT=$(echo | openssl s_client -servername oidc.eks.${1}.amazonaws.com -showcerts -connect oidc.eks.${1}.amazonaws.com:443 2>&- | tail -r | sed -n '/-----END CERTIFICATE-----/,/-----BEGIN CERTIFICATE-----/p; /-----BEGIN CERTIFICATE-----/q' | tail -r | openssl x509 -fingerprint -noout | sed 's/://g' | awk -F= '{print tolower($2)}') THUMBPRINT_JSON="{\"thumbprint\": \"${THUMBPRINT}\"}" echo $THUMBPRINT_JSON