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

Moved the 3legged auth files from flytectl and also added config option for it #156

Merged
merged 7 commits into from
Apr 28, 2021

Conversation

pmahindrakar-oss
Copy link
Contributor

@pmahindrakar-oss pmahindrakar-oss commented Apr 28, 2021

Signed-off-by: Prafulla Mahindrakar [email protected]

TL;DR

Moved the three legged auth to flyteidl and added configuration option for authType
There are two authTypes supported
CLIENTSECRET
THREELEGGEDAUTH

Tested with flytectl conf on demo.nuclyde.io

Config for querying admin

admin:
  # For GRPC endpoints you might want to use dns:///flyte.myexample.com
  clientId: flytectl
  endpoint: dns:///demo.nuclyde.io
  insecure: false
  authType: THREELEGGEDAUTH
logger:
  show-source: true
  level: 6
flytectl get project
Warn: No metricsProvider set for the workqueue
INFO[0000] Using config file: [config.yaml]             
INFO[0000] Config section [root] updated. No update handler registered.  src="viper.go:318"
INFO[0000] Config section [logger] updated. Firing updated event.  src="viper.go:320"
{"json":{"src":"viper.go:320"},"level":"info","msg":"Config section [admin] updated. Firing updated event.","ts":"2021-04-28T21:10:49+05:30"}
{"json":{"src":"viper.go:318"},"level":"info","msg":"Config section [storage] updated. No update handler registered.","ts":"2021-04-28T21:10:49+05:30"}
{"json":{"src":"viper.go:318"},"level":"info","msg":"Config section [adminutils] updated. No update handler registered.","ts":"2021-04-28T21:10:49+05:30"}
{"json":{"src":"client.go:182"},"level":"info","msg":"Instantiating a token source to authenticate against Admin, ID: flytectl","ts":"2021-04-28T21:10:49+05:30"}
{"json":{"src":"token_cache_with_keyring.go:59"},"level":"debug","msg":"fetched token from cache with expiry at 2021-04-29 03:03:19.535504 +0530 IST","ts":"2021-04-28T21:10:51+05:30"}
{"json":{"src":"auth_flow_orchestrator.go:35"},"level":"debug","msg":"got a response from the refresh grant for old expiry 2021-04-29 03:03:19.535504 +0530 IST with new expiry 2021-04-29 03:03:19.535504 +0530 IST","ts":"2021-04-28T21:10:51+05:30"}
{"json":{"src":"client.go:65"},"level":"info","msg":"Initialized Admin client","ts":"2021-04-28T21:10:51+05:30"}
{"json":{"src":"project.go:87"},"level":"debug","msg":"Retrieved 4 projects","ts":"2021-04-28T21:10:51+05:30"}
 --------------- --------------- ---------------------------------- 
| ID (4)        | NAME          | DESCRIPTION                      |
 --------------- --------------- ---------------------------------- 
| flytectldemo  | flytectldemo  | Some description for the project |
 --------------- --------------- ---------------------------------- 
| flyteexamples | flyteexamples | flyteexamples description        |
 --------------- --------------- ---------------------------------- 
| flytesnacks   | flytesnacks   | flytesnacks description          |
 --------------- --------------- ---------------------------------- 
| flytetester   | flytetester   | flytetester description          |
 --------------- --------------- ---------------------------------- 
4 rows

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

flyteorg/flyte#945

Follow-up issue

NA

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Prafulla Mahindrakar <[email protected]>
@EngHabu EngHabu merged commit edbc50c into auth-endpoints Apr 28, 2021
EngHabu pushed a commit that referenced this pull request Apr 29, 2021
…on for it (#156)

* Moved the 3legged auth files from flytectl and also added config option for it

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed the expiry bug

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Changed logic to refresh the token

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Refactored the getAuthenticationDialOption

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
@pmahindrakar-oss pmahindrakar-oss deleted the pmahindrakar/auth-endpoints-flytectl branch April 29, 2021 03:45
EngHabu pushed a commit that referenced this pull request Apr 29, 2021
…on for it (#156)

* Moved the 3legged auth files from flytectl and also added config option for it

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed the expiry bug

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Changed logic to refresh the token

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Refactored the getAuthenticationDialOption

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>
EngHabu added a commit that referenced this pull request Apr 30, 2021
…th in admin client (#155)

* Introduce Auth Metadata and Identity Grpc Service

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* merge conflicts

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Update deps

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* cleanup deps

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* update deps

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Delete unused catalog client

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Remove the need for UseAuth config to simplify setup further

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Add deprecated comment

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Allow config of insecure creds transmission

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Moved the 3legged auth files from flytectl and also added config option for it (#156)

* Moved the 3legged auth files from flytectl and also added config option for it

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed the expiry bug

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Changed logic to refresh the token

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Refactored the getAuthenticationDialOption

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>

* refactor pkce package

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* rename

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* bump for dco

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Added ClientSetBuilder inorder to remove keyring dependency (#158)

* Added ClientSetBuilder inorder to remove keyring dependency

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added token cache to deprecated method too

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Refactoring latest changes

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* rename

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* do not close server right away

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* don't close http server too soon

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* event init error

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Cleanup

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* comments

Signed-off-by: Haytham Abuelfutuh <[email protected]>

Co-authored-by: pmahindrakar-oss <[email protected]>
eapolinario pushed a commit that referenced this pull request Sep 8, 2023
…th in admin client (#155)

* Introduce Auth Metadata and Identity Grpc Service

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* merge conflicts

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Update deps

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* cleanup deps

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* update deps

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Delete unused catalog client

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Remove the need for UseAuth config to simplify setup further

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Add deprecated comment

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Allow config of insecure creds transmission

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Moved the 3legged auth files from flytectl and also added config option for it (#156)

* Moved the 3legged auth files from flytectl and also added config option for it

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed the expiry bug

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Changed logic to refresh the token

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Refactored the getAuthenticationDialOption

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Fixed unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added more unit tests

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>

* refactor pkce package

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* rename

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* bump for dco

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Added ClientSetBuilder inorder to remove keyring dependency (#158)

* Added ClientSetBuilder inorder to remove keyring dependency

Signed-off-by: Prafulla Mahindrakar <[email protected]>

* Added token cache to deprecated method too

Signed-off-by: Prafulla Mahindrakar <[email protected]>
Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Refactoring latest changes

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* rename

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* do not close server right away

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* don't close http server too soon

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* event init error

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* Cleanup

Signed-off-by: Haytham Abuelfutuh <[email protected]>

* comments

Signed-off-by: Haytham Abuelfutuh <[email protected]>

Co-authored-by: pmahindrakar-oss <[email protected]>
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.

2 participants