Skip to content

Commit

Permalink
retrieve eudr admin-regions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexeh committed Feb 27, 2024
1 parent 19abf1c commit edc03a3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
23 changes: 23 additions & 0 deletions api/src/modules/admin-regions/admin-regions.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<AdminRegion> {
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',
Expand Down
2 changes: 1 addition & 1 deletion infrastructure/base/modules/aws/eks/thumbprint.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit edc03a3

Please sign in to comment.