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

ui: Ensure the tokens default nspace is passed thru to the auth endpoint #11472

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

johncowen
Copy link
Contributor

@johncowen johncowen commented Nov 2, 2021

Most HTTP API calls will use the default namespace of the calling token to additionally filter/select the data used for the response if one is not specified by the frontend.

The internal permissions/authorize endpoint does not do this (you can ask for permissions from different namespaces in on request).

Therefore this PR adds the tokens default namespace in the frontend only to our calls to the authorize endpoint. I tried to do it in a place that made it feel like it's getting added in the backend, i.e. in a place which was least likely to ever require changing or thinking about.

Note: 1.10.x base branch, a 1.11 PR to come that will add the same fix but for partitions also, I'm guessing it works better to fix on 1.10 and then add the 1.11 functionality, rather than fix on 1.11 and then remove the functionality not required on 1.10. Added a changelog and no-changelog label here to get around the changelog checker.

P.S. Quick note here. After speaking to @jkirschner-hashicorp and @dnephin we are probably going to change this internal endpoint to also inspect the tokens default namespace on the backend. At which point we can revert this commit/PR. Revert will need to happen on 1.10 and 1.11

@johncowen johncowen added the theme/ui Anything related to the UI label Nov 2, 2021
@vercel vercel bot temporarily deployed to Preview – consul November 3, 2021 17:00 Inactive
@vercel vercel bot temporarily deployed to Preview – consul-ui-staging November 3, 2021 17:00 Inactive
@johncowen johncowen added the pr/no-changelog PR does not need a corresponding .changelog entry label Nov 3, 2021
@johncowen johncowen marked this pull request as ready for review November 3, 2021 17:06
Copy link
Contributor

@kaxcode kaxcode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@johncowen johncowen merged commit 4798222 into release/1.10.x Nov 4, 2021
@johncowen johncowen deleted the ui/bugfix/pass-token-default-ns branch November 4, 2021 12:15
@hc-github-team-consul-core
Copy link
Collaborator

🍒 If backport labels were added before merging, cherry-picking will start automatically.

To retroactively trigger a backport after merging, add backport labels and re-run https://circleci.com/gh/hashicorp/consul/493648.

johncowen added a commit that referenced this pull request Nov 4, 2021
…int (#11472)

Most HTTP API calls will use the default namespace of the calling token to additionally filter/select the data used for the response if one is not specified by the frontend.

The internal permissions/authorize endpoint does not do this (you can ask for permissions from different namespaces in on request).

Therefore this PR adds the tokens default namespace in the frontend only to our calls to the authorize endpoint. I tried to do it in a place that made it feel like it's getting added in the backend, i.e. in a place which was least likely to ever require changing or thinking about.

Note:  We are probably going to change this internal endpoint to also inspect the tokens default namespace on the backend. At which point we can revert this commit/PR.
johncowen added a commit that referenced this pull request Nov 11, 2021
…int (#11472)

Most HTTP API calls will use the default namespace of the calling token to additionally filter/select the data used for the response if one is not specified by the frontend.

The internal permissions/authorize endpoint does not do this (you can ask for permissions from different namespaces in on request).

Therefore this PR adds the tokens default namespace in the frontend only to our calls to the authorize endpoint. I tried to do it in a place that made it feel like it's getting added in the backend, i.e. in a place which was least likely to ever require changing or thinking about.

Note:  We are probably going to change this internal endpoint to also inspect the tokens default namespace on the backend. At which point we can revert this commit/PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/no-changelog PR does not need a corresponding .changelog entry theme/ui Anything related to the UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants