Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

SMQ-2632 - Separate PAT logic in middleware#2636

Open
nyagamunene wants to merge13 commits intoabsmach:main
base:main
Choose a base branch
Loading
fromnyagamunene:MG-2632

Conversation

nyagamunene
Copy link
Contributor

What type of PR is this?

This is a refactor because it seperates PATs logic from Authz middleware

What does this do?

It seperates PATs logic from Authz middleware for users and clients

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

@nyagamunenenyagamunene changed the titleMG-2632 - Separate middleware for PAT logicMG-2632 - Separate PAT logic in middlewareJan 8, 2025
@codecovCodecov
Copy link

codecovbot commentedJan 8, 2025
edited
Loading

Codecov Report

Attention: Patch coverage is0% with1272 lines in your changes missing coverage. Please review.

Project coverage is 34.40%. Comparing base(e7032a6) to head(d0c2318).

Files with missing linesPatch %Lines
groups/middleware/pat.go0.00%397 Missing⚠️
channels/middleware/pat.go0.00%393 Missing⚠️
clients/middleware/pat.go0.00%373 Missing⚠️
users/middleware/pat.go0.00%108 Missing⚠️
clients/middleware/authorization.go0.00%1 Missing⚠️
Additional details and impacted files
@@            Coverage Diff             @@##             main    #2636      +/-   ##==========================================- Coverage   42.32%   34.40%   -7.93%==========================================  Files         350      243     -107       Lines       47867    40108    -7759     ==========================================- Hits        20259    13798    -6461+ Misses      25402    25219     -183+ Partials     2206     1091    -1115

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report?Share it here.

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dborovcanin
Copy link
Collaborator

@arvindh123 Please review this one.

Copy link
Collaborator

@dborovcanindborovcanin left a comment

Choose a reason for hiding this comment

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

@nyagamunene Please resolve conflicts.

@nyagamunenenyagamunene self-assigned thisJan 15, 2025
@nyagamunenenyagamunene changed the titleMG-2632 - Separate PAT logic in middlewareSMQ-2632 - Separate PAT logic in middlewareJan 24, 2025
@nyagamunenenyagamunene requested a review froma team as acode ownerJanuary 27, 2025 09:21
@nyagamunenenyagamuneneforce-pushed theMG-2632 branch 2 times, most recently from8eb9581 to4ae49e8CompareJanuary 27, 2025 10:39
@nyagamunenenyagamuneneforce-pushed theMG-2632 branch 3 times, most recently from3d4f6e6 to816a0e3CompareFebruary 13, 2025 08:37
Copy link
Contributor

@arvindh123arvindh123 left a comment

Choose a reason for hiding this comment

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

We can merge this PR after merging of#2680

@nyagamunenenyagamuneneforce-pushed theMG-2632 branch 2 times, most recently fromacf54d5 toe1f6026CompareFebruary 28, 2025 09:56
Copy link
Collaborator

@dborovcanindborovcanin left a comment

Choose a reason for hiding this comment

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

@nyagamunene What's the status with this one? Please rebase it.

@nyagamunene
Copy link
ContributorAuthor

@nyagamunene What's the status with this one? Please rebase it.

@dborovcanin This is ready I have rebased it.

Comment on lines 104 to 105
if err := am.checkSuperAdmin(ctx, session.UserID); err != nil {
return clients.ClientsPage{}, err
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 the logic here, superadmins and non superadmins can list clients, just set theSuperAdmin boolean

@@ -195,6 +196,15 @@ func main() {
defer authzClient.Close()
logger.Info("AuthZ successfully connected to auth gRPC server " + authzClient.Secure())

pat, patHandler, err := authsvcPat.NewAuthorization(ctx, grpcCfg)
if err != nil {
logger.Error("failed to create authz " + err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

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

could you make this more decriptive to pats authz

Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Signed-off-by: nyagamunene <stevenyaga2014@gmail.com>
Copy link
Contributor

@arvindh123arvindh123 left a comment

Choose a reason for hiding this comment

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@dborovcanindborovcanindborovcanin requested changes

@arvindh123arvindh123arvindh123 requested changes

@felixgaterufelixgaterufelixgateru requested changes

Requested changes must be addressed to merge this pull request.

Assignees

@nyagamunenenyagamunene

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Feature: Separate middleware for PAT logics
4 participants
@nyagamunene@dborovcanin@arvindh123@felixgateru

[8]ページ先頭

©2009-2025 Movatter.jp