Key Lifecycle Rules
A KeyLifecycleRule represents a rule that applies to API keys, GPG keys, and SSH keys (also called User Public Keys) based on their inactivity or age.
Keys that have been unused for the specified number of days will be deleted. SSH keys can also be configured to expire after a specified number of days. SSH key expiration applies only to User Public Keys used for inbound SFTP/SSH login, not Remote Server outbound SSH keys.
List Key Lifecycle Rules
SDK Method
keylifecyclerule.List()
Return Object
[]*KeyLifecycleRule
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
Additional Arguments
Show Key Lifecycle Rule
SDK Method
keylifecyclerule.Find()
Return Object
KeyLifecycleRule
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
KeyLifecycleRuleFindParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Key Lifecycle Rule ID. |
Create Key Lifecycle Rule
SDK Method
keylifecyclerule.Create()
Return Object
KeyLifecycleRule
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
KeyLifecycleRuleCreateParams Fields
| Field | Default | Description |
|---|---|---|
| ApplyToAllWorkspaces boolean | false | If true, a default-workspace rule also applies to keys in all workspaces. |
| ExpirationDays int64 | Number of days after creation before an SSH key expires. Applies only to SSH keys. | |
| KeyType string | Key type for which the rule will apply (gpg, ssh, or api). Possible values: gpg, ssh, api | |
| InactivityDays int64 | Number of days of inactivity before the rule applies. | |
| Name string | Key Lifecycle Rule name | |
| WorkspaceId int64 | 0 | Workspace ID. 0 means the default workspace. |
Update Key Lifecycle Rule
SDK Method
keylifecyclerule.Update()
Return Object
KeyLifecycleRule
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
KeyLifecycleRuleUpdateParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Key Lifecycle Rule ID. |
| ApplyToAllWorkspaces boolean | If true, a default-workspace rule also applies to keys in all workspaces. |
| ExpirationDays int64 | Number of days after creation before an SSH key expires. Applies only to SSH keys. |
| KeyType string | Key type for which the rule will apply (gpg, ssh, or api). Possible values: gpg, ssh, api |
| InactivityDays int64 | Number of days of inactivity before the rule applies. |
| Name string | Key Lifecycle Rule name |
| WorkspaceId int64 | Workspace ID. 0 means the default workspace. |
Delete Key Lifecycle Rule
SDK Method
keylifecyclerule.Delete()
Return Object
No return value.
Authorization Requirement
Requires either a Site-Wide API key or User API key or session from a User with Site Admin permissions.
KeyLifecycleRuleDeleteParams Fields
| Field | Description |
|---|---|
| Id int64 Required | Key Lifecycle Rule ID. |
The KeyLifecycleRule Object
Some of the methods above return a KeyLifecycleRule object. The attributes of this object are listed below.
| Attribute | Description |
|---|---|
| Id int64 | Key Lifecycle Rule ID |
| KeyType string | Key type for which the rule will apply (gpg, ssh, or api). Possible values: gpg, ssh, api |
| InactivityDays int64 | Number of days of inactivity before the rule applies. |
| ExpirationDays int64 | Number of days after creation before an SSH key expires. Applies only to SSH keys. |
| ApplyToAllWorkspaces boolean | If true, a default-workspace rule also applies to keys in all workspaces. |
| Name string | Key Lifecycle Rule name |
| WorkspaceId int64 | Workspace ID. 0 means the default workspace. |