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 added check if anonymous token policy exists into release/1.2.x #2864

Conversation

hc-github-team-consul-core

Backport

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

🚨

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:
@aahel
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: POST https://api.github.com/repos/hashicorp/consul-k8s/merges: 409 Merge conflict []

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


Changes proposed in this PR:

Prevent updating anonymous token if it already exists and is attached to the anonymous token policy

How I've tested this PR:

  • setup the deafault partiton and create a non-default partition called my-partition.
  • modified the anonymous token policy rule.
  • created helm deployment in my-partiton using acl bootstrap token with following policies.
acl = "read"
operator = "read"
agent_prefix "" {
  policy = "read"
}
partition "my-partition" {
  acl = "write"
  mesh = "write"
  peering = "write"
  namespace_prefix "" {
    policy = "write"
  }
  service_prefix "" {
    policy = "write"
  }
}
  • server-acl-acl init was successfull and anonymous token policy rule didn't get updated

How I expect reviewers to test this PR:

Checklist:


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/NET-5174/anonymous-token-policy/positively-learning-dassie branch from 3041401 to 0a8b29a Compare August 30, 2023 05:24
@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/NET-5174/anonymous-token-policy/positively-learning-dassie branch from 0a8b29a to 3041401 Compare August 30, 2023 05:25
* added check if anonymous token policy exists

* changed checkIfAnonymousTokenPolicyExists impl

* made consts private

* added test for configureAnonymousPolicy

* fixed unit test

* fixed test and minor refactoring

* fix typo

* changed some var names

* added changelog
@aahel aahel marked this pull request as ready for review August 30, 2023 07:42
@aahel aahel enabled auto-merge (squash) August 30, 2023 07:45
@aahel aahel merged commit b8b0bb0 into release/1.2.x Aug 30, 2023
3 checks passed
@aahel aahel deleted the backport/NET-5174/anonymous-token-policy/positively-learning-dassie branch August 30, 2023 08:09
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