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

fix(auth): fix Auth0 integration #164

Merged
merged 9 commits into from
Sep 3, 2023
Merged

fix(auth): fix Auth0 integration #164

merged 9 commits into from
Sep 3, 2023

Conversation

TobiaszCudnik
Copy link
Contributor

@TobiaszCudnik TobiaszCudnik commented Aug 25, 2023

Because

  • instill auth login isnt working

This commit

  • missing auth0 vars
  • .env for local dev
  • updated go version
  • aligned build system
  • aligned CI
  • dev and prod tenants working
  • fix callback error

Ticket: https://linear.app/instill-ai/issue/INS-1660/cli-fix-auth-for-cloud-prod

Testing

  1. Create an .env file and fill in the secrets
# SECRETS

# vault / secret / devops / auth0 / prod / client-id
INSTILL_OAUTH_CLIENT_ID=
# vault / secret / devops / auth0 / prod / client-secret
INSTILL_OAUTH_CLIENT_SECRET=

# CONFIG

INSTILL_OAUTH_HOSTNAME=auth.instill.tech
INSTILL_OAUTH_ISSUER=https://auth.instill.tech/
INSTILL_OAUTH_AUDIENCE=https://api.instill.tech
INSTILL_OAUTH_CALLBACK_HOST=localhost
INSTILL_OAUTH_CALLBACK_PORT=8085
  1. make bin/instill
  2. ./bin/instill auth login

Future work

  • integration tests with Auth0
  • auth for Core instances

Signed-off-by: Tobias Cudnik <[email protected]>
Signed-off-by: Tobias Cudnik <[email protected]>
Signed-off-by: Tobias Cudnik <[email protected]>
- .env for local dev
- aligned build system
- instill-dev.eu tenant working

Signed-off-by: Tobias Cudnik <[email protected]>
@linear
Copy link

linear bot commented Aug 25, 2023

INS-1575 CLI v2

In-progress design doc for CLI v2

  • rename to inst
  • baseline references
  • aggregate from >1 source
    • eg --self --cloud
      • sane defaults needed (unlike illa)
    • support for >1 local instance?
    • support for >1 cloud instance?
  • --help as markdown
    • environment --help
    • config --help
    • api --help
  • confirmations for better UX
  • eg instill config set browser firefox says nothing
  • list API methods as docs
    • from swagger
    • filtering
    • eg inst docs --name pipe
  • default API version (eg v1alpha)
  • init ~/.config/instill
  • icons for progress
  • TUI like git-bug (milestone 2)
  • httpie-like syntax for API reqs augmentation
    • eg inst api PUT pie.dev/put X-API-Token:123 name=John
    • milestone 2
    • outdated go impl
  • cmds
    • api
    • auth
    • completion
    • config
    • deploy deploys a VDP instance
    • update tries to update the CLI
    • docs lists API methods from swagger
  • easy install
    • go install github.com/instill-ai/clilatest
    • linux pkgs

Signed-off-by: Tobias Cudnik <[email protected]>
@codecov
Copy link

codecov bot commented Aug 25, 2023

Codecov Report

Patch coverage: 52.63% and project coverage change: +0.02% 🎉

Comparison is base (967e8d1) 50.10% compared to head (3cbac71) 50.13%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #164      +/-   ##
==========================================
+ Coverage   50.10%   50.13%   +0.02%     
==========================================
  Files          48       48              
  Lines        3702     3700       -2     
==========================================
  Hits         1855     1855              
+ Misses       1676     1674       -2     
  Partials      171      171              
Flag Coverage Δ
unittests 50.13% <52.63%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Changed Coverage Δ
api/client.go 7.54% <0.00%> (ø)
internal/config/config_file.go 57.60% <0.00%> (ø)
pkg/cmd/auth/login/login.go 44.44% <0.00%> (+1.20%) ⬆️
pkg/cmdutil/file_input.go 0.00% <0.00%> (ø)
pkg/iostreams/iostreams.go 13.23% <0.00%> (ø)
api/cache.go 75.86% <100.00%> (ø)
internal/update/update.go 57.89% <100.00%> (ø)
pkg/cmd/api/api.go 72.04% <100.00%> (ø)
pkg/cmd/api/http.go 69.31% <100.00%> (ø)
pkg/export/filter.go 42.85% <100.00%> (ø)
... and 2 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@TobiaszCudnik TobiaszCudnik changed the title WIP: INS-1575 fix authentication fix(auth): Auth0 integration Aug 29, 2023
@TobiaszCudnik TobiaszCudnik marked this pull request as ready for review August 29, 2023 15:37
@pinglin pinglin changed the title fix(auth): Auth0 integration fix(auth): fix Auth0 integration Sep 3, 2023
Copy link
Member

@pinglin pinglin left a comment

Choose a reason for hiding this comment

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

LGTM

@pinglin pinglin merged commit d36f340 into main Sep 3, 2023
14 checks passed
@pinglin pinglin deleted the INS-1575-auth0 branch September 3, 2023 19:42
pinglin added a commit that referenced this pull request Sep 3, 2023
Because

- `instill auth login` isnt working

This commit

- missing auth0 vars
- .env for local dev
- updated go version
- aligned build system
- aligned CI
- dev and prod tenants working
- fix callback error

Ticket: https://linear.app/instill-ai/issue/INS-1660/cli-fix-auth-for-cloud-prod

### Testing

1. Create an `.env` file and fill in the secrets
```
# SECRETS

# vault / secret / devops / auth0 / prod / client-id
INSTILL_OAUTH_CLIENT_ID=
# vault / secret / devops / auth0 / prod / client-secret
INSTILL_OAUTH_CLIENT_SECRET=

# CONFIG

INSTILL_OAUTH_HOSTNAME=auth.instill.tech
INSTILL_OAUTH_ISSUER=https://auth.instill.tech/
INSTILL_OAUTH_AUDIENCE=https://api.instill.tech
INSTILL_OAUTH_CALLBACK_HOST=localhost
INSTILL_OAUTH_CALLBACK_PORT=8085
```
2. `make bin/instill`
3. `./bin/instill auth login`

### Future work
- integration tests with Auth0
- auth for Core instances

Co-authored-by: Ping-Lin Chang <[email protected]>
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