Skip to content

Commit

Permalink
Release 0.1 Update 1 (#2)
Browse files Browse the repository at this point in the history
* Update CHANGELOG.md

* Update about_IdentityCommand.help.txt

Update help

* Update IdentityCommand.psd1

Update Icon

* ADD Get-IDUserRole

initial commit of new function.

* 📝 🌐 UPDATE Help

* ADD Get-IDAnalyticsDataset

Initial commit of new command

* ADD Get-IDTenantCname

Initial commit of new function

* ADD Get-IDDownloadUrl

initial commit of function

* 💚 FIX Get-IDDownloadUrl.Tests

Invoke correct command

* ADD Get-IDUserIdentifier

initial commit of new command

* Update Get-IDUserIdentifier.Tests.ps1

* ADD Invoke-IDSqlcmd

Initial Commit of new function

* Update CHANGELOG.md

* Update CHANGELOG.md
  • Loading branch information
pspete committed Aug 30, 2023
1 parent 44839f5 commit c617dc9
Show file tree
Hide file tree
Showing 25 changed files with 1,932 additions and 8 deletions.
29 changes: 29 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,35 @@
# Change Log
All notable changes to this project will be documented in this file.

## [unreleased] - 2023-08-30

### Added
- N/A

### Changed
- N/A

### Fixed
- N/A

## [0.1 - Update 1] - 2023-08-30

Additional Functions

### Added
- `Get-IDUserRole` - Get a list of roles for a user
- `Get-IDAnalyticsDataset` - Get all datasets accessible by a user
- `Get-IDTenantCname` - Get Tenant Cnames
- `Get-IDDownloadUrl` - Get download Urls
- `Get-IDUserIdentifier` - Get the configuration of the user attributes
- `Invoke-IDSqlcmd` - Query the database tables

### Changed
- N/A

### Fixed
- N/A

## [0.1] - 2023-08-21

Initial module development prior to main release
Expand Down
10 changes: 8 additions & 2 deletions IdentityCommand/IdentityCommand.psd1
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,13 @@
'Get-IDTenant',
'Get-IDTenantConfiguration',
'Get-IDConnector',
'New-IDPlatformToken'
'New-IDPlatformToken',
'Get-IDUserRole',
'Get-IDAnalyticsDataset',
'Get-IDTenantCname',
'Get-IDDownloadUrl',
'Get-IDUserIdentifier',
'Invoke-IDSqlcmd'
)

# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry, use an empty array if there are no cmdlets to export.
Expand Down Expand Up @@ -122,7 +128,7 @@
ProjectUri = 'https://github.com/pspete/IdentityCommand/'

# A URL to an icon representing this module.
IconUri = 'https://github.com/pspete/IdentityCommand/blob/main/docs/media/images/IdentityCommand-Logo.png'
IconUri = 'https://raw.githubusercontent.com/pspete/IdentityCommand/main/docs/media/images/IdentityCommand-Logo.png'

# ReleaseNotes of this module
ReleaseNotes = 'https://github.com/pspete/IdentityCommand/blob/main/CHANGELOG.md'
Expand Down
4 changes: 4 additions & 0 deletions IdentityCommand/Private/Get-Parameter.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
object. Specifying additional parameter names/keys here means that the default value assigned
to the BaseParameters parameter will remain unchanged.
.PARAMETER ParametersToKeep
Accepts an array of any additional parameter keys which should be selected from the passed input
object.
.EXAMPLE
$PSBoundParameters | Get-Parameter
Expand Down
21 changes: 21 additions & 0 deletions IdentityCommand/Public/Get-IDAnalyticsDataset.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDAnalyticsDataset {
[CmdletBinding()]
param( )

BEGIN {

$URI = "$Script:tenant_url/analytics/services/v1.0/dataset"

}#begin

PROCESS {

#Send Request
Invoke-IDRestMethod -Uri $URI -Method GET

}#process

END {}#end

}
21 changes: 21 additions & 0 deletions IdentityCommand/Public/Get-IDDownloadUrl.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDDownloadUrl {
[CmdletBinding()]
param( )

BEGIN {

$URI = "$Script:tenant_url/Core/GetDownloadUrls"

}#begin

PROCESS {

#Send Request
Invoke-IDRestMethod -Uri $URI -Method POST

}#process

END {}#end

}
21 changes: 21 additions & 0 deletions IdentityCommand/Public/Get-IDTenantCname.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDTenantCname {
[CmdletBinding()]
param( )

BEGIN {

$URI = "$Script:tenant_url/TenantCnames/UiGet"

}#begin

PROCESS {

#Send Request
Invoke-IDRestMethod -Uri $URI -Method POST

}#process

END {}#end

}
21 changes: 21 additions & 0 deletions IdentityCommand/Public/Get-IDUserIdentifier.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDUserIdentifier {
[CmdletBinding()]
param( )

BEGIN {

$URI = "$Script:tenant_url/UserIdentifiers/Get"

}#begin

PROCESS {

#Send Request
Invoke-IDRestMethod -Uri $URI -Method POST

}#process

END {}#end

}
72 changes: 72 additions & 0 deletions IdentityCommand/Public/Get-IDUserRole.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# .ExternalHelp IdentityCommand-help.xml
function Get-IDUserRole {
[CmdletBinding()]
param(
[parameter(
Mandatory = $true,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[Alias('Uuid')]
[String]$ID,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[int]$Limit,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[int]$PageNumber,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[int]$PageSize,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateRange(-1, 0)]
[int]$Caching,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[string]$SortBy
)

BEGIN {

}#begin

PROCESS {

$URLParameters = $PSBoundParameters | Get-Parameter -ParametersToKeep ID
$BoundParameters = $PSBoundParameters | Get-Parameter -ParametersToRemove ID

$URI = "$Script:tenant_url/UserMgmt/GetUsersRolesAndAdministrativeRights?$($URLParameters | ConvertTo-QueryString)"

$Body = @{'Args' = $BoundParameters } | ConvertTo-Json

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method POST -Body $Body

if ($null -ne $result) {
$result
}

}#process

END { }#end

}
76 changes: 76 additions & 0 deletions IdentityCommand/Public/Invoke-IDSqlcmd.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
function Invoke-IDSqlcmd {
[CmdletBinding()]
param(
[parameter(
Mandatory = $true,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[String]$Script,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[int]$Limit,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[int]$PageNumber,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateNotNullOrEmpty()]
[int]$PageSize,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateRange(-1, 0)]
[int]$Caching,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[bool]$Direction,

[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[string]$SortBy
)

BEGIN {

}#begin

PROCESS {

$URI = "$Script:tenant_url/Redrock/query"

#Create request body with Script & args properties
$Cmd = $PSBoundParameters | Get-Parameter -ParametersToKeep Script
$Cmd.Add('args', $($PSBoundParameters | Get-Parameter -ParametersToRemove Script))
$Body = $Cmd | ConvertTo-Json

#Send Request
$result = Invoke-IDRestMethod -Uri $URI -Method POST -Body $Body

if ($null -ne $result) {
$result.Results.Row
}

}#process

END { }#end

}
8 changes: 4 additions & 4 deletions IdentityCommand/about_IdentityCommand.help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,22 @@ EXAMPLES

Once successfully authenticated, all IdentityCommand module commands which require an authenticated session can be used from within the same PowerShell session.

#### GetBearerToken Method
#### GetToken Method

You may have a scenario where you want to use APIs for which we have not yet developed, built or published module commands.

The GetBearerToken method of the object returned on successful authentication can be invoked to obtain a bearer token to be used for further requests.
The GetToken method of the object returned on successful authentication can be invoked to obtain a bearer token to be used for further requests.

PS C:\> $Session = New-IDSession -tenant_url https://some.tenant.cyberark.cloud -Credential $Credential
PS C:\> $Session.GetBearerToken()
PS C:\> $Session.GetToken()

Name Value
---- -----
Authorization Bearer eyPhbSciPiJEUzT1NEIsInR5cCI6IkpXYZ...

GetWebSession Method

The GetWebSession method can be used in a similar way to GetBearerToken, but the websession object for the authenticated session is returned instead of a Bearer token.
The GetWebSession method can be used in a similar way to GetToken, but the websession object for the authenticated session is returned instead of a Bearer token.

PS C:\> $Session = New-IDSession -tenant_url https://some.tenant.cyberark.cloud -Credential $Credential
PS C:\> $session.GetWebSession()
Expand Down
Loading

0 comments on commit c617dc9

Please sign in to comment.