mirror of
https://github.com/openfaas/faas.git
synced 2025-06-22 23:03:24 +00:00
Migrate to Go modules
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
This commit is contained in:
committed by
Alex Ellis
parent
2e2250afe8
commit
7ce266adc0
15
gateway/vendor/github.com/nats-io/jwt/operator_claims.go
generated
vendored
15
gateway/vendor/github.com/nats-io/jwt/operator_claims.go
generated
vendored
@ -26,7 +26,7 @@ import (
|
||||
|
||||
// Operator specific claims
|
||||
type Operator struct {
|
||||
// Slice of real identies (like websites) that can be used to identify the operator.
|
||||
// Slice of real identities (like websites) that can be used to identify the operator.
|
||||
Identities []Identity `json:"identity,omitempty"`
|
||||
// Slice of other operator NKeys that can be used to sign on behalf of the main
|
||||
// operator identity.
|
||||
@ -40,6 +40,8 @@ type Operator struct {
|
||||
// A list of NATS urls (tls://host:port) where tools can connect to the server
|
||||
// using proper credentials.
|
||||
OperatorServiceURLs StringList `json:"operator_service_urls,omitempty"`
|
||||
// Identity of the system account
|
||||
SystemAccount string `json:"system_account,omitempty"`
|
||||
}
|
||||
|
||||
// Validate checks the validity of the operators contents
|
||||
@ -63,6 +65,11 @@ func (o *Operator) Validate(vr *ValidationResults) {
|
||||
vr.AddError("%s is not an operator public key", k)
|
||||
}
|
||||
}
|
||||
if o.SystemAccount != "" {
|
||||
if !nkeys.IsValidPublicAccountKey(o.SystemAccount) {
|
||||
vr.AddError("%s is not an account public key", o.SystemAccount)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func (o *Operator) validateAccountServerURL() error {
|
||||
@ -112,15 +119,15 @@ func ValidateOperatorServiceURL(v string) error {
|
||||
}
|
||||
|
||||
func (o *Operator) validateOperatorServiceURLs() []error {
|
||||
var errors []error
|
||||
var errs []error
|
||||
for _, v := range o.OperatorServiceURLs {
|
||||
if v != "" {
|
||||
if err := ValidateOperatorServiceURL(v); err != nil {
|
||||
errors = append(errors, err)
|
||||
errs = append(errs, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
return errors
|
||||
return errs
|
||||
}
|
||||
|
||||
// OperatorClaims define the data for an operator JWT
|
||||
|
Reference in New Issue
Block a user