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

Adding 12 Okta Identity Engine (OIE) API Functions #26

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

patrickjburke245
Copy link

Had a code review with Gabriel Sroka to review PowerShell verbs, adding Okta to function definitions, and following API documentation for ID variables. For the 3 endpoints that have body parameters, I followed the definition style from Enable-OktaFactor (

function Enable-OktaFactor($userid, $factorid, $body) {
Invoke-Method POST "/api/v1/users/$userid/factors/$factorid/lifecycle/activate" $body
}
).

Had a code review with Gabriel Sroka to review PowerShell verbs, adding Okta to function definitions, and following API documentation for ID variables. For the 3 endpoints that have body parameters, I followed the definition style from Enable-OktaFactor (https://github.com/gabrielsroka/OktaAPI.psm1/blob/4667b95c3ac051b97b5683e746a3446fbd9f27fd/Modules/OktaAPI.psm1#L124-L126).
@gabrielsroka
Copy link
Owner

gabrielsroka commented Sep 4, 2021

For the 3 endpoints that have body parameters, I followed the definition style from Enable-OktaFactor

i see, but this is not Enable, it's New :)

try

function New-OktaUser($user, $activate = $true, $provider = $false) {
Invoke-Method POST "/api/v1/users?activate=$activate&provider=$provider" $user
}

and
function Set-OktaUser($id, $user) {
# Only the profile properties specified in the request will be modified when using the POST method.
Invoke-Method POST "/api/v1/users/$id" $user
}

Removed "body" from variable names referring to Captcha objects. This was done because this module already abstracts the HTTP request process. Also now differentiating between the Full Update and Partial Updates of "/api/v1/captchas/${id}".
@patrickjburke245
Copy link
Author

patrickjburke245 commented Sep 5, 2021

Updated this PR to fix variable names and add another function. 2 more PRs coming (one for CallOktaAPI.ps1 and one for the README's Usage section).

Added "$null = " to the 2 functions with a DELETE HTTP method to capture whatever is returned.
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