Skip to content

Commit 1bea067

Browse files
authored
Allow underscores in kerberos principal names (#563)
* Allow underscores in kerberos principal names Fixes #562 * Changelog
1 parent 476d216 commit 1bea067

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,16 @@ All notable changes to this project will be documented in this file.
1919

2020
- Default to OCI for image metadata ([#544]).
2121

22+
### Fixed
23+
24+
- Underscores are now allowed in Kerberos principal names ([#563]).
25+
2226
[#528]: https://github.com/stackabletech/secret-operator/pull/528
23-
[#548]: https://github.com/stackabletech/secret-operator/pull/548
24-
[#552]: https://github.com/stackabletech/secret-operator/pull/552
2527
[#544]: https://github.com/stackabletech/secret-operator/pull/544
2628
[#546]: https://github.com/stackabletech/secret-operator/pull/546
29+
[#548]: https://github.com/stackabletech/secret-operator/pull/548
30+
[#552]: https://github.com/stackabletech/secret-operator/pull/552
31+
[#563]: https://github.com/stackabletech/secret-operator/pull/563
2732

2833
## [24.11.1] - 2025-01-10
2934

rust/operator-binary/src/crd.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,7 @@ pub struct KerberosPrincipal(String);
328328
#[snafu(module)]
329329
pub enum InvalidKerberosPrincipal {
330330
#[snafu(display(
331-
"principal contains illegal characters (allowed: alphanumeric, /, @, -, and .)"
331+
"principal contains illegal characters (allowed: alphanumeric, /, @, -, _, and .)"
332332
))]
333333
IllegalCharacter,
334334

@@ -342,7 +342,12 @@ impl TryFrom<String> for KerberosPrincipal {
342342
if value.starts_with('-') {
343343
invalid_kerberos_principal::StartWithDashSnafu.fail()
344344
} else if value.contains(|chr: char| {
345-
!chr.is_alphanumeric() && chr != '/' && chr != '@' && chr != '.' && chr != '-'
345+
!chr.is_alphanumeric()
346+
&& chr != '/'
347+
&& chr != '@'
348+
&& chr != '.'
349+
&& chr != '-'
350+
&& chr != '_'
346351
}) {
347352
invalid_kerberos_principal::IllegalCharacterSnafu.fail()
348353
} else {

0 commit comments

Comments
 (0)