-
Notifications
You must be signed in to change notification settings - Fork 672
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
SMQ-2604 - Change PAT repo implementation #2680
base: main
Are you sure you want to change the base?
Conversation
@nyagamunene Please address comments @arvindh123 left. |
32b153e
to
d5d9b8e
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2680 +/- ##
==========================================
- Coverage 42.08% 35.34% -6.75%
==========================================
Files 341 238 -103
Lines 47488 38794 -8694
==========================================
- Hits 19987 13710 -6277
+ Misses 25318 24000 -1318
+ Partials 2183 1084 -1099 ☔ View full report in Codecov by Sentry. |
auth/pat.go
Outdated
PatId string | ||
OptionalDomainId string `json:"optional_domain_id,omitempty"` | ||
EntityType EntityType `json:"entity_type,omitempty"` | ||
EntityId string `json:"entity_id,omitempty"` | ||
Operation Operation `json:"operation,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we have a scope this complex? Can we have it embedded entity types and operations only?
auth/cache/pat.go
Outdated
key := GenerateKey(sc.PatID, sc.OptionalDomainID, sc.EntityType, sc.Operation, sc.EntityID) | ||
if err := pc.client.Set(ctx, key, true, pc.duration).Err(); err != nil { | ||
return errors.Wrap(repoerr.ErrCreateEntity, err) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add entityID to key and value as only True
pc.client.Set(ctx, key, true, 0).Err()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets add entityID to key and value as only
True
pc.client.Set(ctx, key, true, 0).Err()
The pc.duration
is the time it takes before it expires in the RAM. By setting it to 0 it will never expire. Should this be the case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's have pc.Duration, Don't set to 0, I just gave an example to for key
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
Signed-off-by: nyagamunene <[email protected]>
What type of PR is this?
What does this do?
Which issue(s) does this PR fix/relate to?
Have you included tests for your changes?
Did you document any new/modified feature?
Notes