-
Notifications
You must be signed in to change notification settings - Fork 60
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
Add auth servers #58
Open
FonzMP
wants to merge
5
commits into
Shopify:main
Choose a base branch
from
FonzMP:add_auth_servers
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add auth servers #58
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,164 @@ | ||
module Oktakit | ||
class Client | ||
module AuthorizationServers | ||
# Add Authorization Server | ||
# | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] The created Authorization Server | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#create-authorization-server | ||
# @example | ||
# Oktakit.add_authorization_server | ||
def add_authorization_server(options = {}) | ||
post("/authorizationServers", options) | ||
end | ||
|
||
# Get Authorization Server | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Fetched Authorization Server | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#get-authorization-server | ||
# @example | ||
# Oktakit.get_authorization_server('id') | ||
def get_authorization_server(id, options = {}) | ||
get("/authorizationServers/#{id}", options) | ||
end | ||
|
||
# List Authorization Servers | ||
# | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Array of Authorization Servers | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#list-authorization-servers | ||
# @example | ||
# Oktakit.list_authorization_servers | ||
def list_authorization_servers(options = {}) | ||
get("/authorizationServers", options) | ||
end | ||
|
||
# List Authorization Server Policies | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Array of Authorization Server Policies | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#get-all-policies | ||
# @example | ||
# Oktakit.list_authorization_server_policies('id') | ||
def list_authorization_server_policies(id, options = {}) | ||
get("/authorizationServers/#{id}/policies", options) | ||
end | ||
|
||
# Add Authorization Server Policy | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] The Created Authorization Server Policy | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#create-a-policy | ||
# @example | ||
# Oktakit.add_authorization_server_policy('id') | ||
def add_authorization_server_policy(id, options = {}) | ||
post("/authorizationServers/#{id}/policies", options) | ||
end | ||
|
||
# Update Authorization Server | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Updated Authorization Server | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#update-authorization-server | ||
# @example | ||
# Oktakit.update_authorization_server('id') | ||
def update_authorization_server(id, options = {}) | ||
put("/authorizationServers/#{id}", options) | ||
end | ||
|
||
# Update Authorization Server Policy | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @params policy_id [string] Authorization Server Policy ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] Updated Authorization Server Policy | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#update-a-policy | ||
# @example | ||
# Oktakit.update_authorization_server_policy('id', 'policy_id') | ||
def update_authorization_server_policy(id, policy_id, options = {}) | ||
put("/authorizationServers/#{id}/policies/#{policy_id}", options) | ||
end | ||
|
||
# Delete Authorization Server | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] HTTP 204 No Content | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#delete-authorization-server | ||
# @example | ||
# Oktakit.delete_authorization_server('id) | ||
def delete_authorization_server(id, options = {}) | ||
delete("/authorizationServers/#{id}", options) | ||
end | ||
|
||
# Activate Authorization Server | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] HTTP 204 No Content | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#activate-authorization-server | ||
# @example | ||
# Oktakit.activate_authorization_server('id') | ||
def activate_authorization_server(id, options = {}) | ||
post("/authorizationServers/#{id}/lifecycle/activate") | ||
end | ||
|
||
# Deactivate Authorization Server | ||
# | ||
# @params id [string] Authorization Server ID | ||
# @param options[:query] [Hash] Optional. Query params for request | ||
# @param options[:headers] [Hash] Optional. Header params for the request. | ||
# @param options[:accept] [String] Optional. The content type to accept. Default application/json | ||
# @param options[:content_type] [String] Optional. The content type for the request. Default application/json | ||
# @param options [Hash] Optional. Body params for request. | ||
# @return [Hash<Sawyer::Resource>] HTTP 204 No Content | ||
# @see https://developer.okta.com/docs/reference/api/authorization-servers/#deactivate-authorization-server | ||
# @example | ||
# Oktakit.deactivate_authorization_server('id') | ||
def deactivate_authorization_server(id, options = {}) | ||
post("/authorizationServers/#{id}/lifecycle/deactivate") | ||
end | ||
end | ||
end | ||
end |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Just asking, why is this change needed?
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.
Unsure why specifically this change was made but if I had to guess it was likely to make the application of the
authorization
header uniform with the how the other headers were being set above it. If this is a blocker we can likely revert this change without issue.