Keys
This contains APIs related to Keys as defined in Harness
Lists SSH, PGP, or all Keys based on keyScheme parameter. Supports filtering by fingerprint, subKeyId, usages, and schemes.
Account Identifier for the Entity.
Identifier of the key's Parent Account
Key scheme: ssh (default), pgp, or all
Key fingerprint filter (exact match)
Subkey ID filter (PGP only)
Page Index of the results to fetch.Default Value: 0
0Results per page(max 100)Default Value: 50
50Page Token of the next results to fetch.Default Value: ''
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns the list of Keys matching the criteria.
GET /gateway/ng/api/keys?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
"status": "SUCCESS",
"code": "DEFAULT_ERROR_CODE",
"message": "text",
"correlationId": "text",
"errors": [
{
"fieldId": "text",
"error": "text"
}
]
}Creates a SSH or PGP Key. Use query param keyScheme=ssh (default) or keyScheme=pgp. Defaults to SSH when keyScheme is not passed.
Account Identifier for the Entity.
Key scheme: ssh (default) or pgp
This has the Key details defined in Harness.
Identifier of the Key
Name of the key
This is the time from which the key is valid. The time is in milliseconds.
This is the time till which the key is valid. The time is in milliseconds.
Account Identifier for the Entity.
This is the ID of the Parent entity from which the Token inherits its role bindings.
Description of the key
Public key value
Key ID: Last 8 bytes of the fingerprint
Primary user ID associated with the key
Key algorithm (RSA, DSA, ECDSA, EdDSA)
Key scheme: ssh (default) or pgp
For subkeys: the keyId of the parent/master key. Null for primary keys.
Indicates if this is a subkey (true) or a primary/master key (false)
Revocation reason if the key has been revoked
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns created Key details
POST /gateway/ng/api/keys?accountIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 449
{
"identifier": "text",
"name": "text",
"validFrom": 1,
"validTo": 1,
"accountIdentifier": "text",
"parentIdentifier": "text",
"description": "text",
"tags": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"key": "text",
"keyUsage": [
"SIGN"
],
"keyId": "text",
"primaryUserId": "text",
"keyAlgorithm": "text",
"keyScheme": "SSH",
"identities": [
{
"name": "text",
"email": "text"
}
],
"primaryIdentity": {
"name": "text",
"email": "text"
},
"parentKeyId": "text",
"isSubKey": true,
"revocationReason": "unknown"
}{
"status": "SUCCESS",
"code": "DEFAULT_ERROR_CODE",
"message": "text",
"correlationId": "text",
"errors": [
{
"fieldId": "text",
"error": "text"
}
]
}Updates a Key's validity period or revocation status. For COMPROMISED revocation of PGP keys, the code-api service is notified first.
Key identifier
Account Identifier for the Entity.
Identifier of the key's Parent Account
Request to update public key (SSH/PGP) validity or revocation status
Revocation reason. Cannot be combined with validFrom/validTo.
Start of validity period (epoch millis). Cannot be combined with revocationReason.
End of validity period (epoch millis). Cannot be combined with revocationReason.
Bad Request
This is Failure entity as defied in Harness
Internal server error
Returns the updated Key details
PUT /gateway/ng/api/keys/{identifier}?accountIdentifier=text&parentIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Content-Type: application/json
Accept: */*
Content-Length: 56
{
"revocationReason": "unknown",
"validFrom": 1,
"validTo": 1
}{
"status": "SUCCESS",
"code": "DEFAULT_ERROR_CODE",
"message": "text",
"correlationId": "text",
"errors": [
{
"fieldId": "text",
"error": "text"
}
]
}Deletes a Key (SSH or PGP) by its identifier. For PGP primary keys, all subkeys are also deleted.
Key identifier
Account Identifier for the Entity.
Identifier of the key's Parent Account
Bad Request
This is Failure entity as defied in Harness
Internal server error
It returns true if the Key is deleted successfully and false if the Key is not deleted.
DELETE /gateway/ng/api/keys/{identifier}?accountIdentifier=text&parentIdentifier=text HTTP/1.1
Host: ng-manager-7b6bb5bdbc-5jxjn
Accept: */*
{
"status": "SUCCESS",
"code": "DEFAULT_ERROR_CODE",
"message": "text",
"correlationId": "text",
"errors": [
{
"fieldId": "text",
"error": "text"
}
]
}Last updated
Was this helpful?