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

acl: allow auth methods created in the primary datacenter to optionally create global tokens #7899

Merged
merged 2 commits into from
Jun 1, 2020

Conversation

rboyer
Copy link
Member

@rboyer rboyer commented May 14, 2020

Currently auth methods (and binding rules) are dc-local items that are not replicated between datacenters. They are also restricted to only being able to create dc-local ACL tokens.

This restriction was initially set in place to avoid an availability issue in any application that headlessly would make use of an auth method to dynamically create a token before application start (such as a kubernetes pod pre start hook). If these needed to make a synchronous RPC back to the primary datacenter (that may not even be up) then that would incur both an additional startup delay and the probability of bringing everything to a screeching halt in the event the primary datacenter is briefly disconnected.

While this argument still holds for any auth method used headlessly (type=kubernetes and type=jwt) it is harder to make the same justification for user-driven flows like type=oidc.
In this PR I'm granting auth methods defined in the primary datacenter the option of being configured to exclusively create global ACL tokens.

  • Folks setting up OIDC in their primary datacenter would benefit from enabling this option to allow for the UI to forward requests to other datacenters without needing to SSO...multiple times.
  • Anyone running headless workloads in their primary datacenter could benefit from having this option available for type=kubernetes and type=jwt as well.

@rboyer rboyer added theme/acls ACL and token generation post-beta labels May 14, 2020
@rboyer rboyer added this to the 1.8.0 milestone May 14, 2020
@rboyer rboyer requested a review from a team May 14, 2020 22:03
@rboyer rboyer self-assigned this May 14, 2020
@rboyer
Copy link
Member Author

rboyer commented May 14, 2020

Note that this is not meant to be a fix for #7381.

Copy link
Contributor

@dnephin dnephin left a comment

Choose a reason for hiding this comment

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

What do you think about calling it token-scope instead of token-type ? Type could be a lot of things, but scope may imply something more specific.

website/pages/api-docs/acl/auth-methods.mdx Show resolved Hide resolved
switch method.TokenType {
case "local", "":
case "global":
if !a.srv.InACLDatacenter() {
Copy link
Member

Choose a reason for hiding this comment

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

Is this only a restriction because the secondary servers would require a token to use in the RPC to the primary?

Copy link
Member Author

Choose a reason for hiding this comment

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

That and having to sleep-loop until replication brought your newly-created token back to the secondary.

Copy link
Member

@mkeeler mkeeler left a comment

Choose a reason for hiding this comment

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

LGTM

@rboyer rboyer merged commit 833211c into master Jun 1, 2020
@rboyer rboyer deleted the auth-method-token-type-global branch June 1, 2020 16:44
hashicorp-ci pushed a commit that referenced this pull request Jun 1, 2020
freddygv added a commit that referenced this pull request Jun 18, 2020
…optionally create global tokens (#7899)"

This reverts commit 833211c.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
post-beta theme/acls ACL and token generation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants