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

fix(RBAC): fix scope for release tags #237

Merged
merged 1 commit into from
Mar 27, 2024

Conversation

kjaskiewiczz
Copy link
Contributor

No description provided.

@mender-test-bot
Copy link

Merging these commits will result in the following changelog entries:

Changelogs

go-lib-micro (rbac-fix)

New changes in go-lib-micro since master:

Bug Fixes
  • fix scope for release tags

Copy link
Contributor

@merlin-northern merlin-northern left a comment

Choose a reason for hiding this comment

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

one double-check kiind of comment.

rbac/rbac.go Outdated
@@ -49,7 +49,7 @@ func WithContext(ctx context.Context, scope *Scope) context.Context {
func ExtractScopeFromHeader(r *http.Request) *Scope {
groupStr := r.Header.Get(ScopeHeader)
tagsStr := r.Header.Get(ScopeReleaseTagsHeader)
if len(groupStr) > 0 {
if len(groupStr) || len(tagsStr) > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

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

just to double check: are we sure that for else to this if we are returning nil?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sorry, but I don't understand the comment; can you rephrase?

Copy link
Contributor

Choose a reason for hiding this comment

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

sorry, I am on fire a bit. I meant:

if this:

if len(groupStr) || len(tagsStr) > 0 {

is not true, then we return nil. I wanted just to point your attention to it and double check if that is something we want.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that is something we were already doing (btw, I fixed the condition) and is something we don't want to change

Copy link
Contributor

Choose a reason for hiding this comment

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

copy that

Copy link
Contributor

Choose a reason for hiding this comment

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

I noticed the condition fix. and I was copying this code to the comment -- still failed to notice the new syntax ;-)

Changelog: Title
Ticket: None

Signed-off-by: Krzysztof Jaskiewicz <krzysztof.jaskiewicz@northern.tech>
@kjaskiewiczz kjaskiewiczz merged commit 45e5745 into mendersoftware:master Mar 27, 2024
3 checks passed
@kjaskiewiczz kjaskiewiczz deleted the rbac-fix branch March 27, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants