Skip to content

Commit

Permalink
fix: remove pattern matching from location name
Browse files Browse the repository at this point in the history
Location name should be a DNS label and could be matched by a regex.

Correct one could be "^[a-zA-Z0-9]([a-zA-Z0-9\\-]*[a-zA-Z0-9])*$".

PR #21 has a
discussion about it. But users can defined more values in IPA
location in the FreeIPA server than what the RFCs allow.

From this PoV, it is more important for idmsvc to pass registration
even with slightly invalid DNS label than being valid but failing.
Idmsvc doesn't use the value for DNS operations.

Signed-off-by: Petr Vobornik <[email protected]>
  • Loading branch information
pvoborni committed Sep 27, 2024
1 parent 2ee029a commit 1dec7c9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion public.openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -1373,7 +1373,6 @@
"type": "string",
"maxLength": 63,
"minLength": 1,
"pattern": "^[a-z][a-z0-9\\-]*$",
"x-rh-ipa-hcc": {
"type": "defs"
},
Expand Down
2 changes: 1 addition & 1 deletion public.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -974,12 +974,12 @@ components:
type: defs
x-rh-rdn-value: name
LocationName:
# validation pattern was removed to not be more restrictive than IPA server
title: Location identifier (IPA location, AD site)
description: A location identifier (lower-case DNS label)
type: string
maxLength: 63
minLength: 1
pattern: ^[a-z][a-z0-9\-]*$
x-rh-ipa-hcc:
type: defs
example: alpha
Expand Down

0 comments on commit 1dec7c9

Please sign in to comment.