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 JWT backed implementation of influxdb.Authorizer #14971

Closed
GeorgeMac opened this issue Sep 5, 2019 · 0 comments · Fixed by #15151
Closed

Add JWT backed implementation of influxdb.Authorizer #14971

GeorgeMac opened this issue Sep 5, 2019 · 0 comments · Fixed by #15151

Comments

@GeorgeMac
Copy link
Contributor

Implement a JWT backed authorizer: https://github.com/influxdata/influxdb/blob/master/authz.go#L19

This authorizer should be serializable as a JWT token to be used in communication with gateway. Much like how session works https://github.com/influxdata/influxdb/blob/master/session.go#L35.

Howevever, the token will contain a set of allowed permissions rather than describing the identity of author or owner.

Example scaffold:

package jwt

import platform "github.com/influxdata/influxdb"

var _ platform.Authorizer = (*Authorization)(nil)

type Authorization struct{
    Permissions []platform.Permission
}

func FromToken(token, secret string) (*Authorization, error) {
  // return deserialized authorization or JWT validation error
}

func (a *Authorization) ToToken(secret string) (string, error) {
  // serialize as JWT token string
}

// other required Authorizer methods

Success Criteria

We can start work on adding support for this type of token in gateway.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant