-
Notifications
You must be signed in to change notification settings - Fork 545
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: Add config struct of OpenID-Connect Login #2597
Conversation
api/conf/conf.yaml
Outdated
# host: 127.0.0.1 # the address on which the `Manager API` should listen for HTTPS. | ||
# The default value is 0.0.0.0, if want to specify, please enable it. | ||
# ssl: | ||
# host: 127.0.0.1 # the address on which the `Manager API` should listen for HTTPS. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you change this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, hand shaking...
api/conf/conf.yaml
Outdated
expire_time: 3600 # jwt token expire time, in second | ||
users: # yamllint enable rule:comments-indentation | ||
- username: admin # username and password for login `manager api` | ||
password: admin | ||
- username: user | ||
password: user | ||
|
||
oidcApp: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oidc
would be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK
api/conf/conf.yaml
Outdated
apps: | ||
- appName: authing | ||
clientId: 62f3bafc15fe957a20a2ab1a | ||
clientSecret: 35e4d9c9a21d2176922a4b0395ec1373 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better not put your config here.
api/internal/conf/conf.go
Outdated
ClientSecret string | ||
Scope string | ||
State string | ||
RedirectUri string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should add yaml
flag for each field.
api/conf/conf.yaml
Outdated
# log example: 2020-12-09T16:38:09.039+0800 INFO filter/logging.go:46 /apisix/admin/routes/r1 {"status": 401, "host": "127.0.0.1:9000", "query": "asdfsafd=adf&a=a", "requestId": "3d50ecb8-758c-46d1-af5b-cd9d1c820156", "latency": 0, "remoteIP": "127.0.0.1", "method": "PUT", "errs": []} | ||
# such as: logs/access.log, /tmp/logs/access.log, /dev/stdout, /dev/stderr | ||
# such as absolute path on Windows: winfile:///C:\access.log | ||
# log example: 2020-12-09T16:38:09.039+0800 INFO filter/logging.go:46 /apisix/admin/routes/r1 {"status": 401, "host": "127.0.0.1:9000", "query": "asdfsafd=adf&a=a", "requestId": "3d50ecb8-758c-46d1-af5b-cd9d1c820156", "latency": 0, "remoteIP": "127.0.0.1", "method": "PUT", "errs": []} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better not modify this.
api/conf/conf.yaml
Outdated
# NOTE: Highly recommended to modify this value to protect `manager api`. | ||
# if it's default value, when `manager api` start, it will generate a random string to replace it. | ||
# NOTE: Highly recommended to modify this value to protect `manager api`. | ||
# if it's default value, when `manager api` start, it will generate a random string to replace it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better not modify this.
api/conf/conf.yaml
Outdated
client_id: | ||
client_secret: | ||
scope: oidc | ||
state: 123456 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the state field?
AppName string `mapstructure:"app_name"` | ||
ClientId string `mapstructure:"client_id"` | ||
ClientSecret string `mapstructure:"client_secret"` | ||
Scope string |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to add mapstructure
of this field?
api/conf/conf.yaml
Outdated
secret | ||
expire_time: 3600 | ||
apps: | ||
- app_name: authing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we can support one app first.
So just remove apps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
api/conf/conf.yaml
Outdated
client_id: | ||
client_secret: | ||
scope: oidc | ||
redirect_uri: /authing/callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redirect_uri
shouldn't contain the authing
config.
Maybe oidc/callback
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2597 +/- ##
==========================================
+ Coverage 68.77% 70.39% +1.61%
==========================================
Files 133 195 +62
Lines 3523 7528 +4005
Branches 864 867 +3
==========================================
+ Hits 2423 5299 +2876
- Misses 1100 1936 +836
- Partials 0 293 +293
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
* upstream/master: (23 commits) feat: Add config struct of OpenID-Connect Login (apache#2597) feat: set serverUrlMap with env, update cypress, update stylelint (apache#2583) chore: fix function name typo (apache#2599) fix: page refresh causes deletion exception (apache#2593) feat: support show all enable plugin list tab (apache#2585) fix: drawer components delete plugin not working (apache#2573) feat: add batch delete function for route (apache#2502) test: reduce fe ci time (apache#2557) doc(csp): add correct csp rule (apache#2548) doc: add a notice about the compatibility of Ingress and Dashboard (apache#2552) fix: add judgement for last_report_time (apache#2551) fix: cli test invalid etcd (apache#2544) feat: fix actions version to root version (apache#2521) fix: duplicate ID (apache#2501) fix: block arbitrary file index (apache#2497) docs: update deploy-with-docker.md (apache#2472) feat: translating Turkish for new features (apache#2487) docs: add new import and export docs to sidebar (apache#2485) docs: add data loader and new OpenAPI 3 loader (apache#2484) feat: support data loader in frontend (apache#2480) ... # Conflicts: # api/internal/route.go # web/config/defaultSettings.ts # web/yarn.lock
Please answer these questions before submitting a pull request, or your PR will get closed.
Why submit this pull request?
What changes will this PR take into?
Please update this section with detailed description.
feat: The series PR will add a new feature to the Dashboard to make it support login through OpenID-Connect.
This PR only adds some new config information to the config file.
fix: Fix some errors occurred in go-lint test
Related issues
Checklist: