Skip to content

Commit 188949b

Browse files
authored
[docker-hub-api] Add repository immutable tags endpoints to update settings and validate regex before update (#23179)
<!--Delete sections as needed --> ## Description <!-- Tell us what you did and why --> [docker-hub-api] Add repository immutable tags endpoints to update settings and validate regex before update. ## Related issues or tickets <!-- Related issues, pull requests, or Jira tickets --> - https://docker.atlassian.net/browse/RG-3017 - https://docker.atlassian.net/browse/RG-3018 ## Reviews <!-- Notes for reviewers here --> <!-- List applicable reviews (optionally @tag reviewers) --> - [x] Technical review - [ ] Editorial review - [ ] Product review
1 parent 0d5bbe6 commit 188949b

File tree

2 files changed

+279
-0
lines changed

2 files changed

+279
-0
lines changed

content/reference/api/hub/changelog.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,15 @@ issues for Docker Service APIs.
1515

1616
---
1717

18+
## 2025-07-29
19+
20+
### New
21+
22+
- Add [Update repository immutable tags settings](/reference/api/hub/latest/#tag/repositories/operation/UpdateRepositoryImmutableTags) endpoints for a given `namespace` and `repository`.
23+
- Add [Verify repository immutable tags](/reference/api/hub/latest/#tag/repositories/operation/VerifyRepositoryImmutableTags) endpoints for a given `namespace` and `repository`.
24+
25+
---
26+
1827
## 2025-06-27
1928

2029
### New

content/reference/api/hub/latest.yaml

Lines changed: 270 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,62 @@ paths:
894894
$ref: "#/components/responses/Forbidden"
895895
"404":
896896
$ref: "#/components/responses/NotFound"
897+
/v2/namespaces/{namespace}/repositories/{repository}/immutabletags:
898+
parameters:
899+
- $ref: "#/components/parameters/namespace"
900+
- $ref: "#/components/parameters/repository"
901+
patch:
902+
operationId: UpdateRepositoryImmutableTags
903+
summary: "Update repository immutable tags"
904+
description: |
905+
Updates the immutable tags configuration for this repository.
906+
907+
**Only users with administrative privileges for the repository can modify these settings.**
908+
tags:
909+
- repositories
910+
security:
911+
- bearerAuth: []
912+
requestBody:
913+
$ref: "#/components/requestBodies/update_repository_immutable_tags_request"
914+
responses:
915+
200:
916+
$ref: "#/components/responses/update_repository_immutable_tags_response"
917+
400:
918+
$ref: "#/components/responses/bad_request"
919+
401:
920+
$ref: "#/components/responses/unauthorized"
921+
403:
922+
$ref: "#/components/responses/forbidden"
923+
404:
924+
$ref: "#/components/responses/not_found"
925+
/v2/namespaces/{namespace}/repositories/{repository}/immutabletags/verify:
926+
parameters:
927+
- $ref: "#/components/parameters/namespace"
928+
- $ref: "#/components/parameters/repository"
929+
post:
930+
operationId: VerifyRepositoryImmutableTags
931+
summary: "Verify repository immutable tags"
932+
description: |
933+
Validates the immutable tags regex pass in parameter and returns a list of tags matching it in this repository.
934+
935+
**Only users with administrative privileges for the repository call this endpoint.**
936+
tags:
937+
- repositories
938+
security:
939+
- bearerAuth: []
940+
requestBody:
941+
$ref: "#/components/requestBodies/immutable_tags_verify_request"
942+
responses:
943+
200:
944+
$ref: "#/components/responses/immutable_tags_verify_response"
945+
400:
946+
$ref: "#/components/responses/bad_request"
947+
401:
948+
$ref: "#/components/responses/unauthorized"
949+
403:
950+
$ref: "#/components/responses/forbidden"
951+
404:
952+
$ref: "#/components/responses/not_found"
897953
/v2/repositories/{namespace}/{repository}/groups:
898954
parameters:
899955
- $ref: "#/components/parameters/namespace"
@@ -2154,7 +2210,209 @@ components:
21542210
application/scim+json:
21552211
schema:
21562212
$ref: "#/components/schemas/scim_user"
2213+
update_repository_immutable_tags_response:
2214+
description: ""
2215+
content:
2216+
application/json:
2217+
schema:
2218+
$ref: "#/components/schemas/repository_info"
2219+
immutable_tags_verify_response:
2220+
description: ""
2221+
content:
2222+
application/json:
2223+
schema:
2224+
$ref: "#/components/schemas/immutable_tags_verify_response"
21572225
schemas:
2226+
update_repository_immutable_tags_request:
2227+
type: object
2228+
properties:
2229+
immutable_tags:
2230+
type: boolean
2231+
description: Whether immutable tags are enabled
2232+
immutable_tags_rules:
2233+
type: array
2234+
items:
2235+
type: string
2236+
description: List of immutable tag rules
2237+
example:
2238+
- "v.*"
2239+
- ".*-RELEASE"
2240+
required:
2241+
- immutable_tags
2242+
- immutable_tags_rules
2243+
repository_info:
2244+
type: object
2245+
properties:
2246+
user:
2247+
type: string
2248+
description: Username of the repository owner
2249+
name:
2250+
type: string
2251+
description: Repository name
2252+
namespace:
2253+
type: string
2254+
description: Repository namespace
2255+
repository_type:
2256+
type: string
2257+
nullable: true
2258+
description: Type of the repository
2259+
status:
2260+
type: integer
2261+
description: Repository status code
2262+
status_description:
2263+
type: string
2264+
description: Description of the repository status
2265+
description:
2266+
type: string
2267+
description: Short description of the repository
2268+
is_private:
2269+
type: boolean
2270+
description: Whether the repository is private
2271+
is_automated:
2272+
type: boolean
2273+
description: Whether the repository has automated builds
2274+
star_count:
2275+
type: integer
2276+
format: int64
2277+
description: Number of stars
2278+
pull_count:
2279+
type: integer
2280+
format: int64
2281+
description: Number of pulls
2282+
last_updated:
2283+
type: string
2284+
format: date-time
2285+
example: "2021-01-05T21:06:53.506400Z"
2286+
description: ISO 8601 timestamp of when repository was last updated
2287+
last_modified:
2288+
type: string
2289+
format: date-time
2290+
example: "2021-01-05T21:06:53.506400Z"
2291+
nullable: true
2292+
description: ISO 8601 timestamp of when repository was last modified
2293+
date_registered:
2294+
type: string
2295+
format: date-time
2296+
example: "2021-01-05T21:06:53.506400Z"
2297+
description: ISO 8601 timestamp of when repository was created
2298+
collaborator_count:
2299+
type: integer
2300+
format: int64
2301+
description: Number of collaborators
2302+
affiliation:
2303+
type: string
2304+
nullable: true
2305+
description: Repository affiliation
2306+
hub_user:
2307+
type: string
2308+
nullable: true
2309+
description: Hub user information
2310+
has_starred:
2311+
type: boolean
2312+
description: Whether the current user has starred this repository
2313+
full_description:
2314+
type: string
2315+
nullable: true
2316+
description: Full description of the repository
2317+
permissions:
2318+
$ref: '#/components/schemas/repo_permissions'
2319+
media_types:
2320+
type: array
2321+
items:
2322+
type: string
2323+
nullable: true
2324+
description: Supported media types
2325+
content_types:
2326+
type: array
2327+
items:
2328+
type: string
2329+
description: Supported content types
2330+
categories:
2331+
type: array
2332+
items:
2333+
$ref: '#/components/schemas/category'
2334+
description: Repository categories
2335+
immutable_tags_settings:
2336+
$ref: '#/components/schemas/immutable_tags_settings'
2337+
storage_size:
2338+
type: integer
2339+
format: int64
2340+
nullable: true
2341+
description: Storage size in bytes
2342+
required:
2343+
- user
2344+
- name
2345+
- namespace
2346+
- status
2347+
- status_description
2348+
- description
2349+
- is_private
2350+
- is_automated
2351+
- star_count
2352+
- pull_count
2353+
- last_updated
2354+
- date_registered
2355+
- collaborator_count
2356+
- has_starred
2357+
- permissions
2358+
- media_types
2359+
- content_types
2360+
- categories
2361+
- immutable_tags_settings
2362+
repo_permissions:
2363+
type: object
2364+
properties:
2365+
read:
2366+
type: boolean
2367+
description: Read permission
2368+
write:
2369+
type: boolean
2370+
description: Write permission
2371+
admin:
2372+
type: boolean
2373+
description: Admin permission
2374+
required:
2375+
- read
2376+
- write
2377+
- admin
2378+
immutable_tags_settings:
2379+
type: object
2380+
properties:
2381+
enabled:
2382+
type: boolean
2383+
description: Whether immutable tags are enabled
2384+
rules:
2385+
type: array
2386+
items:
2387+
type: string
2388+
description: List of immutable tag rules
2389+
required:
2390+
- enabled
2391+
- rules
2392+
immutable_tags_verify_request:
2393+
type: object
2394+
properties:
2395+
regex:
2396+
type: string
2397+
pattern: '^[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*$'
2398+
description: 'Immutable tags rule regex pattern. Must match format: [a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*(\\/[a-z0-9]+((\\.|_|__|-+)[a-z0-9]+)*)*'
2399+
example: 'v.*'
2400+
required:
2401+
- regex
2402+
immutable_tags_verify_response:
2403+
type: object
2404+
properties:
2405+
tags:
2406+
type: array
2407+
items:
2408+
type: string
2409+
description: List of tags that match the provided regex pattern
2410+
example:
2411+
- 'v1.0.0'
2412+
- 'v2.1.3'
2413+
- 'latest'
2414+
required:
2415+
- tags
21582416
repository_list_entry:
21592417
type: object
21602418
properties:
@@ -3601,6 +3859,18 @@ components:
36013859
member:
36023860
type: string
36033861
example: jonsnow
3862+
update_repository_immutable_tags_request:
3863+
required: true
3864+
content:
3865+
application/json:
3866+
schema:
3867+
$ref: "#/components/schemas/update_repository_immutable_tags_request"
3868+
immutable_tags_verify_request:
3869+
required: true
3870+
content:
3871+
application/json:
3872+
schema:
3873+
$ref: "#/components/schemas/immutable_tags_verify_request"
36043874
securitySchemes:
36053875
bearerAuth:
36063876
type: http

0 commit comments

Comments
 (0)