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

feat(http): Implementation of v1 authorization #19865

Merged
merged 4 commits into from
Oct 30, 2020
Merged

Conversation

stuartcarnie
Copy link
Contributor

@stuartcarnie stuartcarnie commented Oct 30, 2020

Closes #19768

The PR introduces a new behavior, AuthorizerV1 which is used to authorize requests to a 1.x API. The AuthorizerV1 provides a single function, Authorize, which takes a set of credentials as input and returns an influxdb.Authorizer or error as output. This implementation and an extensive set of tests are found in the v1/authorization package.

This AuthorizerV1 behavior is then used by the http/legacy package to authorize /write and /query requests.

@stuartcarnie stuartcarnie added the area/2.x OSS 2.0 related issues and PRs label Oct 30, 2020
@stuartcarnie stuartcarnie self-assigned this Oct 30, 2020
The `AuthorizerV1` defines the behavior for authorizing an InfluxDB
1.x API using `CredentialsV1`. These credentials are extracted from
an API, such as the Authorization header of a HTTP request.
Setup the AuthorizerV1 in the launcher and pass this to the V1
authentication handler for authorizing 1.x HTTP requests.
Copy link
Contributor

@brettbuddin brettbuddin left a comment

Choose a reason for hiding this comment

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

Small nit, but otherwise looks great.

v1/authorization/authorizer.go Outdated Show resolved Hide resolved
Copy link
Contributor

@brettbuddin brettbuddin left a comment

Choose a reason for hiding this comment

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

🥳

@stuartcarnie stuartcarnie merged commit 13b3bb8 into master Oct 30, 2020
@stuartcarnie stuartcarnie deleted the sgc/issues/19768 branch October 30, 2020 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/2.x OSS 2.0 related issues and PRs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update v1 HTTP handlers to use v1 authorization
2 participants