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

Permit bearer_token field to be JSON #1078

Closed
wants to merge 1 commit into from
Closed

Conversation

bilbof
Copy link
Contributor

@bilbof bilbof commented Jun 15, 2021

This enables the bearer_token option for the JsonClient to be a JSON with the structure '{"value": <string>}'.

Trello: https://trello.com/c/6Uaayg1l/545-use-a-single-rotation-lambda-instead-of-duplicating-them-per-secret

Motivation

We would like to store additional data with the secret body, to enable rotation of the bearer token with configuration for the rotation provided in the secret body.

E.g. the secret body may look like this:

{ "api_user": "publisher@alphagov.co.uk", "value": "123", "application": "publishing-api" }

The value field would contain the bearer token string. The remaining fields would enable rotation by a Lambda.

This should not have an impact on the existing platform. I expect secrets stored in govuk-secrets to remain unchanged. This will only impact secrets stored in AWS SecretsManager for the new ECS-hosted platform.

This enables the bearer_token option for the JsonClient
to be a JSON with the structure '{"value": <string>}'.

The motivation is that we would like to store additional data
with the secret body, to facilitate rotation of the bearer
token purely from the secret body.

E.g. the secret body may look like this:
'{ "api_user": "publisher@alphagov.co.uk", "value": "123",
   "application": "publishing-api" }'

The `value` field would contain the bearer token string.
The remaining fields would enable rotation by a Lambda
with all configuration for the rotation provided in the
body of the secret.
@bilbof
Copy link
Contributor Author

bilbof commented Jun 15, 2021

This isn't necessary, since we can specify json-key in the ARN provided in the valueFrom field: https://docs.aws.amazon.com/AmazonECS/latest/developerguide/specifying-sensitive-data-secrets.html#secrets-envvar

Thanks @sengi!

@bilbof bilbof closed this Jun 15, 2021
@bilbof bilbof deleted the bilbof/json-bearer-token branch June 15, 2021 09:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant