Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

OAuth2 #8

Merged
merged 48 commits into from
Nov 11, 2019
Merged

OAuth2 #8

merged 48 commits into from
Nov 11, 2019

Conversation

wild-endeavor
Copy link
Contributor

@wild-endeavor wild-endeavor commented Oct 1, 2019

This adds OAuth2 support for Flyte Admin.

  • Most of the logic has been implemented in the auth package. Care was taken, at least attepted, to separate logic that exclusively dealt with oauth into this package.
  • The code implements the authorization code flow, which means you'll need a client secret, and there is no implicit flow.
  • Most of the core logic is in the handlers.go file, which has functions that create handlers (both HTTP and gRPC) that can be attached to existing servers. See the serve.go file to see usage.
  • Encrypted cookies are used to store the user's access (oidc) and refresh tokens. Two other cookies (the CSRF token and the final redirect page) are stored unencypted.
  • Reworked some of the options handling around the base server logic in serve.go, specifically around SSL handling.

Docs forthcoming in the main flyte repo. Also more unit tests and metrics here in another PR after the remaining auth work is done.

Yee Hing Tong and others added 28 commits September 29, 2019 14:12
…nd cookies into a cookie manager from other files
…l, add a new redirect url, move config to a separate object inside the auth package
* switched out the jwt-go library for the go-oidc library, which is also capable of handling jwt verification, and is even better because it caches jwks key sets.

* delete old tests and comment
…an just the RFC specified ones like 'authorization' because Envoy.
…t, add a new grpc interceptor that renames the authorization header from a custom one to the official one
CORS support for gwmux
katrogan
katrogan previously approved these changes Oct 31, 2019
Copy link
Contributor

@katrogan katrogan left a comment

Choose a reason for hiding this comment

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

sorry for a bunch of nits but this looks really great!

pkg/auth/auth_context.go Outdated Show resolved Hide resolved
pkg/auth/auth_context.go Outdated Show resolved Hide resolved
pkg/auth/cookie.go Show resolved Hide resolved
pkg/auth/cookie.go Outdated Show resolved Hide resolved
pkg/auth/handler_utils.go Show resolved Hide resolved
pkg/auth/handlers.go Outdated Show resolved Hide resolved
pkg/auth/handlers.go Show resolved Hide resolved
pkg/auth/handlers.go Show resolved Hide resolved
pkg/auth/handlers.go Outdated Show resolved Hide resolved
pkg/server/cors.go Show resolved Hide resolved
@wild-endeavor wild-endeavor merged commit f0403ac into master Nov 11, 2019
schottra added a commit that referenced this pull request Nov 14, 2019
* origin/master:
  Metadata url and base url as items in the auth context (#33)
  OAuth2 (#8)
  Log links merging logic should take log link names into account (#32)
  Generic type support in workflow compiler (#31)
  Fix invalid filter function error message (#30)
  Support postgres extra options [gcp] (#27)
  Fix no auth provider [gcp] (#28)
@honnix
Copy link
Member

honnix commented Nov 20, 2019

As a reminder, https://github.com/lyft/flyteadmin/pull/8/files#diff-10cb7b7d10da61a9793a32f86a893485L5 makes sandbox deployment in flyte repo incompatible now with master.

@wild-endeavor
Copy link
Contributor Author

@honnix thank you... I'll fix soon. forgot to do that.

eapolinario pushed a commit that referenced this pull request Sep 6, 2023
This adds OAuth2 support for Flyte Admin.

* Most of the logic has been implemented in the auth package.  Care was taken, at least attepted, to separate logic that exclusively dealt with oauth into this package.
* The code implements the authorization code flow, which means you'll need a client secret, and there is no implicit flow.
* Most of the core logic is in the `handlers.go` file, which has functions that create handlers (both HTTP and gRPC) that can be attached to existing servers.  See the `serve.go` file to see usage.
* Encrypted cookies are used to store the user's access (oidc) and refresh tokens.  Two other cookies (the CSRF token and the final redirect page) are stored unencypted.
 * Reworked some of the options handling around the base server logic in `serve.go`, specifically around SSL handling.

Docs forthcoming in the main flyte repo.  Also more unit tests and metrics here in another PR after the remaining auth work is done.
wild-endeavor added a commit that referenced this pull request Sep 26, 2023
Also clean up the logic around resolving parameter and literal map a bit more.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants