Skip to content

Commit

Permalink
ocm provider authorizer: configuration to disable check takes precedence
Browse files Browse the repository at this point in the history
This is preliminary to be able to support OCM without ScienceMesh
  • Loading branch information
glpatcern committed Dec 18, 2023
1 parent fab3678 commit b87b80b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/ocm/provider/authorizer/json/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@ func (a *authorizer) IsProviderAllowed(ctx context.Context, pi *ocmprovider.Prov
}

switch {
case !providerAuthorized:
return errtypes.NotFound(pi.GetDomain())
case !a.conf.VerifyRequestHostname:
return nil
case !providerAuthorized:
return errtypes.NotFound(pi.GetDomain())
case len(pi.Services) == 0:
return errtypes.NotSupported("No IP provided")
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/ocm/provider/authorizer/mentix/mentix.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,10 @@ func (a *authorizer) IsProviderAllowed(ctx context.Context, pi *ocmprovider.Prov
}

switch {
case !providerAuthorized:
return errtypes.NotFound(pi.GetDomain())
case !a.conf.VerifyRequestHostname:
return nil
case !providerAuthorized:
return errtypes.NotFound(pi.GetDomain())
case len(pi.Services) == 0:
return errtypes.NotSupported(
fmt.Sprintf("mentix: provider %s has no supported services", pi.GetDomain()))
Expand Down

0 comments on commit b87b80b

Please sign in to comment.