Skip to content

Commit 37bc0ba

Browse files
Merge pull request #81 from okta/lr-prepare-release-2.0
Prepare 2.0 release
2 parents 147e56b + 266695c commit 37bc0ba

File tree

3 files changed

+102
-4
lines changed

3 files changed

+102
-4
lines changed

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,23 @@
22

33
Running changelog of releases since `1.0.0`
44

5+
## 2.0.0
6+
7+
Starting with the 2.x series, the Okta.PowerShell module supports PowerShell 7+.
8+
9+
### New Features
10+
11+
- Added support to revoke tokens (#67)
12+
- Exposed a new exception called `OktaApiException` for API errors (#78)
13+
- Updated readme with new samples such as "Create custom objects", "configure a web proxy", "List resources that match a filter criteria", "Get logs" and "Error handling".
14+
15+
### Bug fixes
16+
17+
- Fixed "Parameter existence checking in functions treats $false value as no parameter" (#56)
18+
- Fixed "Rate limit functionality doesn't work" (#61)(#70)
19+
- Fixed "Get-OktaLogs changes the required date format for "since" and "until" query params" (#55)
20+
- Improved testability (#74)
21+
522
## 1.0.0
623

724
- We're excited to release the first generally available version of the Okta.PowerShell module. Please, check out the [README](./README.md) file to learn more about its capabilities.

MIGRATING.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,36 @@ This module uses semantic versioning and follows Okta's [library version policy]
44

55
## Migrating from 1.x to 2.x
66

7-
* We removed the `Invoke-OktaRemoveAccessToken` and replaced it by `Invoke-OktaRevokeAccessToken` which will revoke your access token and remove it from your configuration object.
7+
* We removed the `Invoke-OktaRemoveAccessToken` command and replaced it by `Invoke-OktaRevokeAccessToken` which revokes your access token and remove it from your configuration object. You can execute the following command to [revoke your token](https://developer.okta.com/docs/guides/revoke-tokens):
8+
9+
```powershell
10+
Invoke-OktaRevokeAccessToken
11+
```
12+
13+
* We added a new exception called `OktaApiException` which is thrown when the Okta API returns 4xx/5xx responses. You can catch an `OktaApiException` and access the Okta API error details. For example, if the API returns a 429 response with the following content: `{"errorCode":"E0000047","errorSummary":"API call exceeded rate limit due to too many requests.","errorLink":"E0000047","errorId":"oae6dB62BdhRFCF_9ltxiklFQ","errorCauses":[]}`, you can access these details from the exception:
14+
15+
```powershell
16+
try{
17+
$Result = Invoke-OktaListApplications
18+
}
19+
catch{
20+
$_.Exception.StatusCode.Value__ | Should -Be 429;
21+
$_.Exception.ErrorCode | Should -Be "E0000047"
22+
$_.Exception.ErrorSummary | Should -Be "API call exceeded rate limit due to too many requests."
23+
$_.Exception.ErrorLink | Should -Be "E0000047"
24+
$_.Exception.ErrorId | Should -Be "oae6dB62BdhRFCF_9ltxiklFQ"
25+
$_.Exception.ErrorCauses | Should -BeNullOrEmpty
26+
$_.Exception.Headers | Should -Not -Be $null
27+
}
28+
```
29+
30+
* We updated the OpenAPI spec for the System Log API, and the query parameters `since` and `until` changed their type from `System.Nullable[System.DateTime]` to `String`. Since the System Log API requires `since` and `until` query parameters to be ISO 8601 compliant timestamp, make sure to format dates accordingly:
31+
32+
```powershell
33+
$since = (Get-Date).AddMonths(-6).ToString("yyyy-MM-ddTHH:mm:ssZ")
34+
$until = (Get-Date).ToString("yyyy-MM-ddTHH:mm:ssZ")
35+
Get-OktaLogs -since $since -until $until
36+
37+
```
38+
39+
* We fixed the rate limit functionality which wasn't working as expected. Check out the [PR #78](https://github.com/okta/okta-powershell-cli/pull/78) for more details.

README.md

Lines changed: 52 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@ This library uses semantic versioning and follows Okta's [library version policy
3535

3636
| Version | Status |
3737
| ------- | ------------------------- |
38-
| 1.x | :heavy_check_mark: Stable |
38+
| 2.x | :heavy_check_mark: Stable |
39+
| 1.x | :warning: Retiring on Aug 21st 2025 |
3940

4041
The latest release can always be found on the [releases page][github-releases]. For more information about our SDKs' lifecycle, check out [our docs](https://developer.okta.com/code/library-versions/).
4142

@@ -52,14 +53,13 @@ If you run into problems using the Okta PowerShell module, you can
5253
This PowerShell module is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project:
5354

5455
- API version: 3.0.0
55-
- SDK version: 1.0.0
5656
- Build package: org.openapitools.codegen.languages.PowerShellClientCodegen
5757
For more information, please visit [https://developer.okta.com/](https://developer.okta.com/)
5858

5959
<a id="frameworks-supported"></a>
6060
The Okta PowerShell module is compatible with:
6161

62-
- PowerShell 6.2 or later
62+
- PowerShell 7.0 or later
6363
- Mac/Windows
6464
- OIE and Classic Okta orgs
6565

@@ -356,6 +356,55 @@ $NewApp = Initialize-OktaOpenIdConnectApplication -Label "New App" -SignOnMode "
356356
357357
> Note: For more API samples checkout our [tests](https://github.com/okta/okta-powershell-cli/tree/main/tests/)
358358
359+
### List resources that match a filter criteria
360+
361+
Certain Okta APIs allow you to list a subset of resources that match a supported filter expression, query, or search criteria. For example, the Groups API enables you to provide filter criteria via query parameters to return a subset of groups. **These query parameters require URL encoding, which is handled internally by the Okta.PowerShell module**. This ensures that your queries are correctly formatted and processed by the Okta API without any additional effort on your part.
362+
363+
#### List groups using the `search` parameter
364+
365+
* Search groups that are of the type `OKTA_GROUP`:
366+
367+
```powershell
368+
Invoke-OktaListGroups -Search 'type eq "OKTA_GROUP"'
369+
```
370+
371+
Internally, the Okta.PowerShell module will encode the search criteria as `/api/v1/groups?search=type+eq+%22OKTA_GROUP%22`.
372+
373+
* Search groups which name is equals to `IAM Team`:
374+
375+
```powershell
376+
Invoke-OktaListGroups -Search 'profile.name eq "IAM Team"'
377+
```
378+
Internally, the Okta.PowerShell module will encode the search criteria as `/api/v1/groups?search=profile.name+eq+%22IAM+Team%22`.
379+
380+
#### List groups using the `filter` parameter
381+
382+
* Filter groups that are of the type `OKTA_GROUP` with profile updated after 11/11/2015
383+
384+
```powershell
385+
Invoke-OktaListGroups -Filter 'type eq "OKTA_GROUP" and lastUpdated gt "2016-11-11T00:00:00.000Z"'
386+
```
387+
388+
Internally, the Okta.PowerShell module will encode the filter criteria as `/api/v1/groups?filter=lastUpdated+gt+%222015-10-05T00%3a00%3a00.000Z%22`.
389+
390+
* Filter groups by ID
391+
392+
```powershell
393+
$GroupId = "00g6hmia52o0aTHx35d7"
394+
Invoke-OktaListGroups -Filter "id eq `"$GroupId`""
395+
```
396+
> Note: Notice `$GroupId` is enclosed in double quotes.
397+
398+
Internally, the Okta.PowerShell module will encode the filter criteria as `/api/v1/groups?filter=id+eq+%2200g6hmia52o0aTHx35d7%22`.
399+
400+
#### List groups using the `q` parameter
401+
402+
Finds a group that matches the name property
403+
404+
```powershell
405+
Invoke-OktaListGroups -Q "everyone"
406+
```
407+
359408
### Get logs
360409

361410
Since the System Log API requires `since` and `until` query params to be ISO 8601 compliant timestamp, make sure to format dates accordingly:

0 commit comments

Comments
 (0)