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

Use application/json as content type when returning credentials #115

Merged
merged 1 commit into from
Mar 17, 2022

Conversation

dleen
Copy link
Contributor

@dleen dleen commented Mar 16, 2022

The credentials are returned as a JSON object so update the content type
to match instead of text/plain.

@patricksanders
Copy link
Contributor

I misled you with my recommendation earlier. 🤦 TokenMiddleware() is used for IMDSv2 token validation/enforcement. Making the change there only effects the IMDS endpoint because the ECS metadata service doesn't use the same token dance as IMDS.

I just pushed a change to your branch that moves the header setting into both (IMDS and ECS) credential handlers. I still need to update/add tests for the changed functionality, but manual testing showed success.

Use application/json as content type when returning credentials

The credentials are returned as a JSON object so update the content type
to match instead of text/plain.

move content-type to handlers for cred endpoints

update pre-commit config to use https for git, remove content-type check from test

set content-type in handlers instead of middleware
@patricksanders patricksanders merged commit 4d87188 into Netflix:master Mar 17, 2022
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.

2 participants