feat: support time_zone for user registration context

This commit is contained in:
Ilia Denisov
2026-04-09 09:00:06 +02:00
parent e6b73a8f55
commit 7043af4cb3
40 changed files with 3452 additions and 164 deletions
@@ -91,6 +91,20 @@ func ParseClientPublicKey(value string) (common.ClientPublicKey, error) {
return key, nil
}
// ParseTimeZone trims value and validates it as an IANA time zone name.
func ParseTimeZone(value string) (string, error) {
timeZone := NormalizeString(value)
if timeZone == "" {
return "", InvalidRequest("time_zone must not be empty")
}
if _, err := time.LoadLocation(timeZone); err != nil {
return "", InvalidRequest("time_zone must be a valid IANA time zone name")
}
return timeZone, nil
}
// ParseRevokeReasonCode trims value and validates it as one machine-readable
// revoke reason code.
func ParseRevokeReasonCode(value string) (common.RevokeReasonCode, error) {