=== Helix Git Fusion User Keys [[get_git_fusion_v1_user_keys]] ==== `GET /git-fusion/v1/users/[user]/keys` Returns a list of all keys for a user. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `user` | See <<encode_uri>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response Body JSON Response consists of a list of hashes - each entry containing a key for specified user with file name under which the key is stored. [source,json] ---- [ { 'key_name': 'key_file_name', 'user': 'jdoe', 'key': "-----BEGIN PUBLIC KEY-----\nSSHKEYCONTENT\n-----END PUBLIC KEY-----" }, { 'key_name': 'other_key_file_name', 'user': 'jdoe', 'key': "-----BEGIN PUBLIC KEY-----\nSSHKEYCONTENT2\n-----END PUBLIC KEY-----" } ] ---- [[put_git_fusion_v1_keys_user_key_name]] ==== `PUT /git-fusion/v1/users/[user]/keys/[key_name]` Submits a new SSH key for specified user under chosen name. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `user` | Encoded version of perforce username. See <<encode_uri>> | `key_name` | Encoded version of key name. See <<encode_uri>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Request JSON Body The request should be file contents of a new SSH key that should be submitted. An example request body might look like: [source,plain] ---- -----BEGIN PUBLIC KEY----- SSHKEYCONTENT5 -----END PUBLIC KEY----- ---- ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response Body JSON See <<error_responses>> for the format of failures. [[delete_git_fusion_v1_delete_key]] ==== `DELETE /git-fusion/v1/users/[user]/keys/[key_name]` Deletes specified key for chosen user. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `user` | Encoded version of perforce username. See <<encode_uri>> | `key_name` | Encoded version of key name. See <<encode_uri>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response JSON Body See <<error_responses>> for the format of failures. [[delete_git_fusion_v1_user_keys]] ==== `DELETE /git-fusion/v1/users/[user]/keys` Deletes all SSH keys for specified user. ===== Request URL Path Parameters [cols="2*", options="header"] |=== | Parameter | Description | `user` | See <<encode_uri>> |=== ===== Request Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Authorization` | See <<authentication>> | `Accept` | `application/json` | `X-Perforce-Helix_Web_Services-*` | See <<per_request_configuration>> |=== ===== Response Headers [cols="2*", options="header"] |=== | Header Name | Notes | `Content-Type` | `application/json` |=== ===== Response JSON Body See <<error_responses>> for the format of failures. [[encode_uri]] ==== Encoding Perforce username & SSH key names All perforce usernames and SSH key names present in URL's must be encoded by replacing https://tools.ietf.org/html/rfc3986#section-2.2[reserved characters as defined by RFC3986 section 2.2 general-delimeters] with a percent sign followed by a hexadecimal representation of codepoint of the character.
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 16014 | Doug Scheirer | Merge down from main | ||
//guest/perforce_software/helix-web-services/main/source/doc/git_fusion/keys.asc | |||||
#1 | 15969 | tjuricek |
Add support for repo creation/update and deletion, same for SSH keys. Add util module for supporting methods, modify temp client to dissapear. (Modified submit of review 15549 by @ptomiak) |