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

MG-2048 - Implement Personal Access Tokens (PATs) #2492

Open
wants to merge 25 commits into
base: auth-refactor
Choose a base branch
from

Conversation

nyagamunene
Copy link
Contributor

@nyagamunene nyagamunene commented Oct 28, 2024

What type of PR is this?

This is a feature because it adds the following functionality: It add personal access token.

What does this do?

It adds personal access token.

Which issue(s) does this PR fix/relate to?

Have you included tests for your changes?

Yes

Did you document any new/modified feature?

No

Notes

@nyagamunene nyagamunene self-assigned this Oct 28, 2024
@dborovcanin dborovcanin changed the title MG-2048 - Personal Access Tokens MG-2048 - implement Personal Access Tokens (PATs) Oct 28, 2024
@nyagamunene nyagamunene changed the base branch from main to auth-refactor November 7, 2024 09:50
@nyagamunene nyagamunene marked this pull request as ready for review November 10, 2024 20:11
@@ -109,3 +109,4 @@ func encodeAuthorizeRequest(_ context.Context, grpcReq interface{}) (interface{}
Object: req.Object,
}, nil
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this line

Comment on lines 52 to 67

type authPATReq struct {
paToken string
platformEntityType string
optionalDomainID string
optionalDomainEntityType string
operation string
entityIDs []string
}

func (req authPATReq) validate() error {
if req.paToken == "" {
return apiutil.ErrBearerToken
}
return nil
}
Copy link
Contributor

Choose a reason for hiding this comment

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

This was not used anywhere

@@ -42,5 +42,5 @@ func (a authentication) Authenticate(ctx context.Context, token string) (authn.S
if err != nil {
return authn.Session{}, errors.Wrap(errors.ErrAuthentication, err)
}
return authn.Session{DomainUserID: res.GetId(), UserID: res.GetUserId(), DomainID: res.GetDomainId()}, nil
return authn.Session{ID: res.GetId(), UserID: res.GetUserId(), DomainID: res.GetDomainId()}, nil
Copy link
Contributor

Choose a reason for hiding this comment

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

Please revert to DomainUserID,This affect everywhere, since we are using DomainUserID in all places

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since domain was removed from token this will be empty

@arvindh123 arvindh123 force-pushed the auth-refactor branch 2 times, most recently from 3f43476 to 4323d34 Compare November 12, 2024 18:21
@dborovcanin dborovcanin force-pushed the auth-refactor branch 2 times, most recently from 33a88f8 to c1faa58 Compare November 26, 2024 11:41
@dborovcanin dborovcanin changed the title MG-2048 - implement Personal Access Tokens (PATs) MG-2048 - Implement Personal Access Tokens (PATs) Nov 26, 2024
arvindh123 and others added 7 commits November 27, 2024 13:34
- Set/Unset parent Group for Things and Channels (absmach#2486)
- Move groups out of pkg (absmach#2493)
- Separate Things authn and Channels authz (absmach#2496)

Signed-off-by: Arvindh <[email protected]>

NOISSUE - Add Publish/Subscribe to channels (absmach#2497)

Signed-off-by: Arvindh <[email protected]>

MG-2457 - Update auth tests (absmach#2503)

Signed-off-by: Felix Gateru <[email protected]>

MG-2477 - Replace Things with Clients (absmach#2508)

Signed-off-by: Dusan Borovcanin <[email protected]>

NOISSUE - Rename Things to Clients

Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Arvindh <[email protected]>
Signed-off-by: Arvindh <[email protected]>
Signed-off-by: Felix Gateru <[email protected]>
Co-authored-by: Arvindh <[email protected]>
felixgateru and others added 2 commits November 27, 2024 13:34
Signed-off-by: Felix Gateru <[email protected]>
Signed-off-by: Arvindh <[email protected]>
Co-authored-by: Arvindh <[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]>
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.

Implement Personal Access Tokens (PATs)
3 participants