<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                # Keys API > 原文:[https://docs.gitlab.com/ee/api/keys.html](https://docs.gitlab.com/ee/api/keys.html) * [Get SSH key with user by ID of an SSH key](#get-ssh-key-with-user-by-id-of-an-ssh-key) * [Get user by fingerprint of SSH key](#get-user-by-fingerprint-of-ssh-key) * [Get user by deploy key fingerprint](#get-user-by-deploy-key-fingerprint) # Keys API[](#keys-api "Permalink") ## Get SSH key with user by ID of an SSH key[](#get-ssh-key-with-user-by-id-of-an-ssh-key "Permalink") 通過 SSH 密鑰的 ID 獲取具有用戶的 SSH 密鑰. 請注意,只有管理員才能通過 SSH 密鑰 ID 用用戶查找 SSH 密鑰. ``` GET /keys/:id ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `id` | integer | yes | SSH 密鑰的 ID | 請求示例: ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/keys/1" ``` ``` { "id": 1, "title": "Sample key 25", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt1256k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", "created_at": "2015-09-03T07:24:44.627Z", "expires_at": "2020-05-05T00:00:00.000Z" "user": { "name": "John Smith", "username": "john_smith", "id": 25, "state": "active", "avatar_url": "http://www.gravatar.com/avatar/cfa35b8cd2ec278026357769582fa563?s=40\u0026d=identicon", "web_url": "http://localhost:3000/john_smith", "created_at": "2015-09-03T07:24:01.670Z", "bio": null, "location": null, "public_email": "john@example.com", "skype": "", "linkedin": "", "twitter": "", "website_url": "", "organization": null, "last_sign_in_at": "2015-09-03T07:24:01.670Z", "confirmed_at": "2015-09-03T07:24:01.670Z", "last_activity_on": "2015-09-03", "email": "john@example.com", "theme_id": 2, "color_scheme_id": 1, "projects_limit": 10, "current_sign_in_at": null, "identities": [], "can_create_group": true, "can_create_project": true, "two_factor_enabled": false "external": false, "private_profile": null } } ``` ## Get user by fingerprint of SSH key[](#get-user-by-fingerprint-of-ssh-key "Permalink") 您可以搜索擁有特定 SSH 密鑰的用戶. 請注意,只有管理員才能使用 SSH 密鑰的指紋查找 SSH 密鑰. ``` GET /keys ``` | Attribute | Type | Required | Description | | --- | --- | --- | --- | | `fingerprint` | string | yes | SSH 密鑰的指紋 | 請求示例: ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/keys?fingerprint=ba:81:59:68:d7:6c:cd:02:02:bf:6a:9b:55:4e:af:d1" ``` 如果使用 sha256 指紋 API 調用,請確保指紋經過 URL 編碼. 例如, `/`由`/`表示,而`:`由`:`表示: ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/keys?fingerprint=SHA256%3AnUhzNyftwADy8AH3wFY31tAKs7HufskYTte2aXo%2FlCg" ``` 響應示例: ``` { "id": 1, "title": "Sample key 1", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt1016k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", "created_at": "2019-11-14T15:11:13.222Z", "expires_at": "2020-05-05T00:00:00.000Z" "user": { "id": 1, "name": "Administrator", "username": "root", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "web_url": "http://0.0.0.0:3000/root", "created_at": "2019-11-14T15:09:34.831Z", "bio": null, "location": null, "public_email": "", "skype": "", "linkedin": "", "twitter": "", "website_url": "", "organization": null, "last_sign_in_at": "2019-11-16T22:41:26.663Z", "confirmed_at": "2019-11-14T15:09:34.575Z", "last_activity_on": "2019-11-20", "email": "admin@example.com", "theme_id": 1, "color_scheme_id": 1, "projects_limit": 100000, "current_sign_in_at": "2019-11-19T14:42:18.078Z", "identities": [ ], "can_create_group": true, "can_create_project": true, "two_factor_enabled": false, "external": false, "private_profile": false, "shared_runners_minutes_limit": null, "extra_shared_runners_minutes_limit": null } } ``` ## Get user by deploy key fingerprint[](#get-user-by-deploy-key-fingerprint "Permalink") 在 GitLab 12.7 中[引入](https://gitlab.com/gitlab-org/gitlab/-/issues/119209) . 部署密鑰綁定到創建用戶,因此,如果使用部署密鑰指紋進行查詢,則將獲得有關使用該密鑰的項目的其他信息. 請求示例: ``` curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/keys?fingerprint=SHA256%3AnUhzNyftwADy8AH3wFY31tAKs7HufskYTte2aXo%2FlCg" ``` 響應示例: ``` { "id": 1, "title": "Sample key 1", "key": "ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt1016k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0=", "created_at": "2019-11-14T15:11:13.222Z", "user": { "id": 1, "name": "Administrator", "username": "root", "state": "active", "avatar_url": "https://www.gravatar.com/avatar/e64c7d89f26bd1972efa854d13d7dd61?s=80&d=identicon", "web_url": "http://0.0.0.0:3000/root", "created_at": "2019-11-14T15:09:34.831Z", "bio": null, "location": null, "public_email": "", "skype": "", "linkedin": "", "twitter": "", "website_url": "", "organization": null, "last_sign_in_at": "2019-11-16T22:41:26.663Z", "confirmed_at": "2019-11-14T15:09:34.575Z", "last_activity_on": "2019-11-20", "email": "admin@example.com", "theme_id": 1, "color_scheme_id": 1, "projects_limit": 100000, "current_sign_in_at": "2019-11-19T14:42:18.078Z", "identities": [ ], "can_create_group": true, "can_create_project": true, "two_factor_enabled": false, "external": false, "private_profile": false, "shared_runners_minutes_limit": null, "extra_shared_runners_minutes_limit": null }, "deploy_keys_projects": [ { "id": 1, "deploy_key_id": 1, "project_id": 1, "created_at": "2020-01-09T07:32:52.453Z", "updated_at": "2020-01-09T07:32:52.453Z", "can_push": false } ] } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看