Skip to content

Commit

Permalink
disable JamfSpec secrets validation (#45959)
Browse files Browse the repository at this point in the history
  • Loading branch information
tigrato authored Aug 28, 2024
1 parent 164ec45 commit d489930
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 39 deletions.
7 changes: 0 additions & 7 deletions api/types/jamf.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,6 @@ func ValidateJamfSpecV1(s *JamfSpecV1) error {
return trace.BadParameter("spec required")
}

// Jamf can handle both credential sets being present, so we let it pass.
hasUserPass := s.Username != "" && s.Password != ""
hasAPICreds := s.ClientId != "" && s.ClientSecret != ""
if !hasUserPass && !hasAPICreds {
return trace.BadParameter("either username+password or clientID+clientSecret must be provided")
}

switch u, err := url.Parse(s.ApiEndpoint); {
case err != nil:
return trace.BadParameter("invalid API endpoint: %v", err)
Expand Down
32 changes: 0 additions & 32 deletions api/types/jamf_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -125,38 +125,6 @@ func TestValidateJamfSpecV1(t *testing.T) {
}),
wantErr: "missing hostname",
},
{
name: "username empty",
spec: modify(func(spec *types.JamfSpecV1) {
spec.Username = ""
}),
wantErr: "username",
},
{
name: "password empty",
spec: modify(func(spec *types.JamfSpecV1) {
spec.Password = ""
}),
wantErr: "password",
},
{
name: "client_id empty",
spec: modify(func(spec *types.JamfSpecV1) {
spec.Username = ""
spec.Password = ""
spec.ClientSecret = "supersecretsecret!!1!"
}),
wantErr: "clientID",
},
{
name: "client_secret empty",
spec: modify(func(spec *types.JamfSpecV1) {
spec.Username = ""
spec.Password = ""
spec.ClientId = "llama-UUID"
}),
wantErr: "clientSecret",
},
{
name: "inventory nil entry",
spec: modify(func(spec *types.JamfSpecV1) {
Expand Down

0 comments on commit d489930

Please sign in to comment.