Show the deploy key SHA256 fingerprint example without its prefix

What does this MR do and why?

This is the follow-up the reviewer asked for on !254540 (merged): make the API entity document fingerprint_sha256 the way !254540 (merged) makes the deploy keys page document it. I said I would open it once !254540 (merged) merged; I am opening it now instead, because the two change no file in common and can merge in either order.

API::Entities::DeployKey documented fingerprint_sha256 with the example SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU, but no response carries that prefix. Key#generate_fingerprint strips it before saving (public_key.fingerprint_sha256.gsub("SHA256:", "")), and the column is a sha256_attribute, so Gitlab::Database::Sha256Attribute#deserialize reads it back as the bare Base64 digest. The example is now Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU, which is the SHA256 fingerprint of the entity's own example key (ssh-keygen -lf on that key prints SHA256:Jrs3LD1Ji30xNLtTVf9NDCj7kkBgPBb2pjvTZ3HfIgU) and the same digest !254540 (merged) uses on doc/api/deploy_keys.md.

The two OpenAPI documents repeat the example, in APIEntitiesDeployKey and APIEntitiesDeployKeysProject (v3) and API_Entities_DeployKey and API_Entities_DeployKeysProject (v2):

  • doc/api/openapi/openapi_v3.yaml is regenerated with bin/rake gitlab:openapi:v3:generate, and the diff it produced is exactly those two lines. bin/rake gitlab:openapi:v3:check_docs reports the document up to date.
  • doc/api/openapi/openapi_v2.yaml was regenerated with bin/rake gitlab:openapi:v2:generate too, but on current master that task adds about 7,000 lines and removes about 5,400 that are unrelated to this change, because the v2 document is not checked in CI and has drifted. I kept only the two hunks that change this example and left the rest of the file as it is on master, so this MR does not carry an unrelated refresh of the v2 document.

I did not touch doc/api/deploy_keys.md, which !254540 (merged) corrects, or the translated files under doc-locale/, which are produced by the translation tooling.

I left out a changelog trailer: only the OpenAPI documents are generated from this example, and the response itself is unchanged.

References

How to set up and validate locally

  1. Add a deploy key to a project and call GET /projects/:id/deploy_keys/:key_id. The fingerprint_sha256 in the response has no SHA256: prefix, like the new example.
  2. Run bin/rake gitlab:openapi:v3:check_docs and see that the OpenAPI v3 document is up to date.
  3. Optional: run ssh-keygen -lf on the example key in lib/api/entities/deploy_key.rb and compare its SHA256 fingerprint with the example, without the prefix.

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports

Loading
Loading