-
Notifications
You must be signed in to change notification settings - Fork 146
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
Enabling "Bearer" as an additional AuthorizationMode #307
Conversation
@outofjungle Thanks for the PR! Someone from our team will review this soon. cc: @monde @bretterer |
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.
@outofjungle I can't take this PR with the changes made to the test files.
okta/application.go
Outdated
@@ -153,7 +153,6 @@ func (m *ApplicationResource) ListApplications(ctx context.Context, qp *query.Pa | |||
apps[i] = &application[i] | |||
} | |||
return apps, resp, nil | |||
|
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 see the latest mvdan.cc/gofumpt@latest is causing all of these white space issues. Sad.
tests/unit/client_config_test.go
Outdated
_, _, err := tests.NewClient( | ||
context.TODO(), | ||
okta.WithAuthorizationMode("SSWS"), | ||
okta.WithOrgUrl("https://test.okta.com"), |
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.
Our tests run in CI against a real Okta Org with these env variables:
OKTA_CLIENT_ORGURL
OKTA_CLIENT_TOKEN
OKTA_CLIENT_CLIENTID
OKTA_CLIENT_PRIVATEKEY
so overriding the config variables with fake values is unacceptable.
@outofjungle I thought about this further. Bearer token is for OAuth which is specific to Okta applications. One other ask, we'd need you to submit a Okta Individual Contributor License Agreement https://developer.okta.com/cla/ as this is new behavior being added to the SDK. |
@monde Yes, your assumptions are correct. This is a new feature where I'm using an out-of-band logic to get a Bearer token for a user via scoped app. I will update the documentation and update the PR. I also emailed my signed CLA just now. I will revert the test changes. Looks like I can't set them up correctly on my laptop and get them to pass. |
Awesome @outofjungle , thanks. Can you revert the |
@monde Updated the README with a section for Bearer token. As many types of apps mint bearer token, I tried my best to document all that i'm aware of. Let me know if the documentation is acceptable. |
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.
Awesome, thank you @outofjungle
@outofjungle I have to create a PR from the otka/okta-sdk-golang repo itself and cherry pick in your work due to the security we have on our CI runs. This will be released in v2.13.0 but I don't think that will happen until next week we have a couple of PRs in our api spec that are being worked through |
@monde Thanks for the approval and your update. Next week is totally fine with me :) |
This was released in v2.13.0 https://github.com/okta/okta-sdk-golang/releases/tag/v2.13.0 |
Summary
Bearer
as an authorization mode in addition to SWSS and PrivateKeyFixes #
Type of PR
Test Information
The fresh checkout of the code from master did not pass many tests. I was able to fix the unit tests, however I didn't have time to fix the integration tests.
Go Version: go version go1.18 darwin/amd64
Os Version: Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:22 PDT 2022; root:xnu-8020.121.3~4/RELEASE_X86_64 x86_64
OpenAPI Spec Version:
Signoff
make fmt
on my code