Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing ResourceOwner type validation #2751

Open
wants to merge 1 commit into
base: 1.11.x-jetty11
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions core/msd/src/main/java/com/yahoo/athenz/msd/MSDSchema.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ private static Schema build() {
sb.stringType("TransportPolicySubjectExternal")
.pattern("(([a-zA-Z0-9][a-zA-Z0-9-:._]*\\.)*[a-zA-Z0-9][a-zA-Z0-9-:._]*)(\\/[0-9]{1,3})?");

sb.stringType("ResourceOwner")
.comment("a ResourceOwner must be one of the 3 values: msd | tf-msd | ignore")
.pattern("^(msd|tf-msd|ignore)$");

sb.enumType("TransportPolicyEnforcementState")
.comment("Types of transport policy enforcement states")
.element("ENFORCE")
Expand Down
4 changes: 4 additions & 0 deletions core/msd/src/main/rdl/Names.tdl
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,7 @@ type StaticWorkloadFQDN String (pattern="({StaticWorkloadComponent}\\.)*{StaticW
type StaticWorkloadName String (pattern="({StaticWorkloadFQDN})(\\/[0-9]{1,3})?");

type TransportPolicySubjectExternal String (pattern="({StaticWorkloadFQDN})(\\/[0-9]{1,3})?");

// a ResourceOwner must be one of the 3 values: msd | tf-msd | ignore
type ResourceOwner String (pattern="^(msd|tf-msd|ignore)$");