-
Notifications
You must be signed in to change notification settings - Fork 112
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
Add Authorization support #38
Merged
Merged
Changes from 9 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
674011d
Add auth secrets configuration to NatsCluster spec
wallyqs 3ca0ca6
Add permissions config
wallyqs 4518928
Setup clients auth if secret is present
wallyqs cf51932
Add example clients auth configuration
wallyqs 7668d98
Update AuthorizationConfig for nats config file
wallyqs d191876
Use json encoder for unmarshalling to disable escaping html
wallyqs b68ab43
Include permissions settings for clients only for now
wallyqs 095df92
Add example JSON config for auth
wallyqs 384fbec
Merge branch 'master' into auth-support
wallyqs e865d85
Bump default nats server version to 1.1.0
wallyqs ab8e732
Remove hack to convert nats conf to JSON
wallyqs 532df85
Update throughout to use version 1.1.0
wallyqs b920108
Still use natsconf marshal helper to prevent html escaping
wallyqs 5447920
Bump version of operator to v0.2.1
wallyqs 2e3f86d
Update tests from config package
wallyqs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
{ | ||
"users": [ | ||
{ "username": "user1", "password": "user1secret" }, | ||
{ "username": "user2", "password": "user2secret", | ||
"permissions": { | ||
"publish": ["hello.*"], | ||
"subscribe": ["hello.world"] | ||
} | ||
} | ||
], | ||
"default_permissions": { | ||
"publish": ["SANDBOX.*"], | ||
"subscribe": ["PUBLIC.>"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
apiVersion: "nats.io/v1alpha2" | ||
kind: "NatsCluster" | ||
metadata: | ||
name: "example-nats-auth" | ||
spec: | ||
size: 3 | ||
version: "1.0.4" | ||
|
||
auth: | ||
# Definition in JSON of the users permissions | ||
clientsAuthSecret: "nats-clients-auth" | ||
|
||
# How long to wait for authentication | ||
clientsAuthTimeout: 5 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
since
gnatsd
v1.1.0 is out, could wait for the Docker image to be available and remove all of this and just use JSON here (filed issue to remove: #39)