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

Add Authorization support #38

Merged
merged 15 commits into from
Mar 29, 2018
Merged

Add Authorization support #38

merged 15 commits into from
Mar 29, 2018

Conversation

wallyqs
Copy link
Member

@wallyqs wallyqs commented Mar 23, 2018

This adds support for configuring users and permissions on subjects on a NatsCluster. The users permissions have to be defined as a Secret in JSON which is then included as part of the configuration of the server:

kubectl create secret generic nats-clients-auth --from-file=clients-auth-permissions.json

Then as part of the NatsCluster definition, it is specified what is the secret from where the users permissions will be picked up:

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"

Fixes #1
Fixes #31

buf := &bytes.Buffer{}
encoder := json.NewEncoder(buf)
encoder.SetEscapeHTML(false)
err := encoder.Encode(conf)
Copy link
Member Author

@wallyqs wallyqs Mar 23, 2018

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)

Copy link
Member

@ColinSullivan1 ColinSullivan1 left a comment

Choose a reason for hiding this comment

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

LGTM with a visual pass through. I agree with the thought you mentioned in slack about waiting for the gnatsd v1.1.0 docker image for JSON support.

@wallyqs wallyqs merged commit 855f8ab into master Mar 29, 2018
@wallyqs wallyqs deleted the auth-support branch March 29, 2018 16:17
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.

2 participants