We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We need to make this user ID, rather than the token. Originally posted by @dborovcanin in absmach/magistrala-old#272 (comment)
For this function we are required to use the UserID instead of token to authorize the subject over the object.
func (svc service) Authorize(ctx context.Context, pr PolicyReq) error { if err := svc.PolicyValidation(pr); err != nil { return errors.Wrap(svcerr.ErrMalformedEntity, err) } if pr.SubjectKind == TokenKind { key, err := svc.Identify(ctx, pr.Subject) if err != nil { return errors.Wrap(svcerr.ErrAuthentication, err) } if key.Subject == "" { if pr.ObjectType == GroupType || pr.ObjectType == ThingType || pr.ObjectType == DomainType { return errors.ErrDomainAuthorization } return svcerr.ErrAuthentication } pr.Subject = key.Subject pr.Domain = key.Domain } if err := svc.checkPolicy(ctx, pr); err != nil { return err } return nil }
Should-have
No response
The text was updated successfully, but these errors were encountered:
@dborovcanin Please provide your approach guidance for this task.
Sorry, something went wrong.
dborovcanin
nyagamunene
No branches or pull requests
Is your feature request related to a problem? Please describe.
We need to make this user ID, rather than the token.
Originally posted by @dborovcanin in absmach/magistrala-old#272 (comment)
Describe the feature you are requesting, as well as the possible use case(s) for it.
For this function we are required to use the UserID instead of token to authorize the subject over the object.
Indicate the importance of this feature to you.
Should-have
Anything else?
No response
The text was updated successfully, but these errors were encountered: