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

Allow configuring a custom endpoint #1142

Merged
merged 1 commit into from
Jun 1, 2022
Merged

Allow configuring a custom endpoint #1142

merged 1 commit into from
Jun 1, 2022

Conversation

ido50
Copy link
Contributor

@ido50 ido50 commented May 30, 2022

The ability to configure a custom URL endpoint for the Okta API is added
to the provider. This is useful for unit testing or running local
caching proxies.

A new configuration option called "custom_endpoint" is added, which by
default takes the value of the "OKTA_CUSTOM_ENDPOINT" environment
variable. When used, and if the provided endpoint is an HTTP endpoint
(rather than an HTTPS endpoint), the HTTPS check is automatically
disabled.

A unit test called TestCustomEndpoint is added which also showcases
unit testing of the Okta API without actually contacting Okta.
Information about the new configuration option is also added to the
documentation.

@monde monde self-assigned this Jun 1, 2022
okta/config.go Show resolved Hide resolved
okta/provider.go Show resolved Hide resolved
@monde
Copy link
Collaborator

monde commented Jun 1, 2022

@ido50 let me know what you think my suggestion of OKTA_HTTP_PROTOCOL . We need you to sign our CLA https://developer.okta.com/cla/ in order to take this PR.

@ido50
Copy link
Contributor Author

ido50 commented Jun 1, 2022

Signed and sent CLA. Thanks.

okta/config.go Outdated
@@ -33,6 +34,7 @@ type (
Config struct {
orgName string
domain string
customEndpoint string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Asking for name customEndpoint be named httpProxy per the main discussion on the PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also updated the commit message to reflect these changes.

The ability to configure a proxy URL endpoint for the Okta API is added
to the provider. This is useful for unit testing or running local
caching proxies.

A new configuration option called "http_proxy" is added, which by
default takes the value of the "OKTA_HTTP_PROXY" environment
variable. When used, and if the provided endpoint is an HTTP endpoint
(rather than an HTTPS endpoint), the HTTPS check is automatically
disabled.

A unit test called `TestHTTPProxy` is added which also showcases
unit testing of the Okta API without actually contacting Okta.
Information about the new configuration option is also added to the
documentation.
@monde monde added the CLA Has Okta Individual Contributor License Agreement label Jun 1, 2022
Copy link
Collaborator

@monde monde left a comment

Choose a reason for hiding this comment

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

Excellent idea @ido50

@monde
Copy link
Collaborator

monde commented Jun 1, 2022

@ido50 this will be released in 3.29.0 either tomorrow or Friday.

@monde monde merged commit 9059f5c into okta:master Jun 1, 2022
@gilcoh33
Copy link

gilcoh33 commented Jun 8, 2022

@ido50 this will be released in 3.29.0 either tomorrow or Friday.

Hi @monde - any ETA for the 3.29.0 release?

@monde
Copy link
Collaborator

monde commented Jun 8, 2022

hi @gilcoh33 , v3.29.0 will be released either today or tomorrow. I'm trying to get #1149 and #1137 addressed in the release.

@monde
Copy link
Collaborator

monde commented Jun 10, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Has Okta Individual Contributor License Agreement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants