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

Backport of Stop referenced jwt providers from being deleted into release/1.16.x #17789

Merged

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #17755 to be assessed for backporting due to the inclusion of the label backport/1.16.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@roncodingenthusiast
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: unable to process merge commit: "75e26d338e6229895be3e44fc6542f846d659d12", automatic backport requires rebase workflow

The below text is copied from the body of the original PR.


Description

  • Intentions can only reference existing jwt providers
  • To improve ux this PR limits the deletion of jwt providers that are referenced by intentions

Testing & Reproduction steps

  • create a jwt-provider
consul config write jwt-provider.hcl

# jwt-provider.hcl

Kind = "jwt-provider"
Name = "okta"


// Issuer is the entity that must have issued the JWT.
Issuer = "auth0"

JSONWebKeySet = {
    Local = {
      JWKS = "eyJrZXlzIjpbeyJrdHk....."
    }
}
  • write an intention
consul config write intention.hcl

# intention.hcl
Kind = "service-intentions"
Name = "redis"

JWT = {
  Providers = [{ Name = "okta" }]
}
Sources = [{
    Name = "*"
    Action = "allow"
}]
  • attempt to delete the okta provider
config delete -name "okta" -kind "jwt-provider"

=> Error deleting config entry jwt-provider/okta: Unexpected response code: 500 (cannot delete jwt provider config entry referenced by an intention. Provider name:okta)
  • Now delete the intention
consul config delete -name "redis" -kind "service-intentions"

=> Config entry deleted: service-intentions/redis
  • try deleting the provider again
consul config delete -name "okta" -kind "jwt-provider"

=> Config entry deleted: jwt-provider/okta

TODO

  • potentially add some more tests

Overview of commits

Copy link
Collaborator

Choose a reason for hiding this comment

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

Auto approved Consul Bot automated PR

@roncodingenthusiast roncodingenthusiast marked this pull request as ready for review June 16, 2023 15:02
@roncodingenthusiast roncodingenthusiast merged commit aa4b01a into release/1.16.x Jun 16, 2023
@roncodingenthusiast roncodingenthusiast deleted the backport/NET-3703/reasonably-certain-mullet branch June 16, 2023 15:03
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.

3 participants