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

Implement admin authenticator #5

Merged
merged 11 commits into from
Nov 13, 2023
Merged

Conversation

1995parham
Copy link
Member

Admin authenticator will provides superuser access for its company users. It uses the same tenant concept in Soteria as other authenticators.

@1995parham 1995parham self-assigned this Nov 11, 2023
@1995parham 1995parham linked an issue Nov 11, 2023 that may be closed by this pull request
@1995parham 1995parham marked this pull request as draft November 11, 2023 14:56
@1995parham
Copy link
Member Author

@mohammadiahmad @mehditeymorian code is not finished yet but if you can tell about your opinions on this, it would be great.

Copy link

codecov bot commented Nov 11, 2023

Codecov Report

Merging #5 (0e45e83) into main (0fdc964) will increase coverage by 7.50%.
The diff coverage is 21.73%.

@@            Coverage Diff             @@
##             main       #5      +/-   ##
==========================================
+ Coverage   17.00%   24.51%   +7.50%     
==========================================
  Files          10       11       +1     
  Lines         682      722      +40     
==========================================
+ Hits          116      177      +61     
+ Misses        563      531      -32     
- Partials        3       14      +11     
Files Coverage Δ
internal/api/auth.go 0.00% <0.00%> (ø)
internal/authenticator/auto_authenticator.go 21.81% <0.00%> (+10.49%) ⬆️
internal/authenticator/manual_authenticator.go 62.19% <0.00%> (+54.69%) ⬆️
internal/authenticator/admin_authenticator.go 41.66% <41.66%> (ø)
internal/authenticator/builder.go 0.00% <0.00%> (ø)

📣 Codecov offers a browser extension for seamless coverage viewing on GitHub. Try it in Chrome or Firefox today!

// ACL check a system user access to a topic.
// because we returns is-admin: true, this endpoint shouldn't
// be called.
func (a AdminAuthenticator) ACL(
Copy link
Member

Choose a reason for hiding this comment

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

@1995parham In long term view we can think about restricting services on their topics.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right Ahmad jan, EMQ has a concept which creates tenants for you by prefixing topics. We can use this feature for supporting different vendors but right now we need shared topics. For example Snapp Box want to read the Snapp events this means we need to validate Snapp Box tokens for Snapp topics.

@1995parham 1995parham marked this pull request as ready for review November 11, 2023 23:37
Copy link
Member

@mehditeymorian mehditeymorian left a comment

Choose a reason for hiding this comment

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

Everything seems well put together.🔥

@1995parham 1995parham merged commit 64dc8d1 into main Nov 13, 2023
7 checks passed
@1995parham 1995parham deleted the 4-support-internal-authentication branch November 13, 2023 11:22
1995parham added a commit that referenced this pull request Dec 20, 2023
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.

Support internal authentication
3 participants