Fix Set Policy on Groups with spaces (#3453)

This commit is contained in:
Cesar N.
2024-10-28 12:28:07 -07:00
committed by GitHub
parent 8c1ecae68a
commit dc19984f23
5 changed files with 2 additions and 17 deletions

View File

@@ -5965,8 +5965,7 @@ func init() {
} }
}, },
"iamEntity": { "iamEntity": {
"type": "string", "type": "string"
"pattern": "^[\\w+=,.@-]{1,64}$"
}, },
"iamPolicy": { "iamPolicy": {
"type": "object", "type": "object",
@@ -14895,8 +14894,7 @@ func init() {
} }
}, },
"iamEntity": { "iamEntity": {
"type": "string", "type": "string"
"pattern": "^[\\w+=,.@-]{1,64}$"
}, },
"iamPolicy": { "iamPolicy": {
"type": "object", "type": "object",

View File

@@ -25,9 +25,7 @@ package models
import ( import (
"context" "context"
"github.com/go-openapi/errors"
"github.com/go-openapi/strfmt" "github.com/go-openapi/strfmt"
"github.com/go-openapi/validate"
) )
// IamEntity iam entity // IamEntity iam entity
@@ -37,15 +35,6 @@ type IamEntity string
// Validate validates this iam entity // Validate validates this iam entity
func (m IamEntity) Validate(formats strfmt.Registry) error { func (m IamEntity) Validate(formats strfmt.Registry) error {
var res []error
if err := validate.Pattern("", "body", string(m), `^[\w+=,.@-]{1,64}$`); err != nil {
return err
}
if len(res) > 0 {
return errors.CompositeValidationError(res...)
}
return nil return nil
} }

View File

@@ -3706,7 +3706,6 @@ definitions:
iamEntity: iamEntity:
type: string type: string
pattern: '^[\w+=,.@-]{1,64}$'
addPolicyRequest: addPolicyRequest:
type: object type: object

View File

@@ -208,7 +208,6 @@ export interface SetPolicyMultipleNameRequest {
groups?: IamEntity[]; groups?: IamEntity[];
} }
/** @pattern ^[\w+=,.@-]{1,64}$ */
export type IamEntity = string; export type IamEntity = string;
export interface AddPolicyRequest { export interface AddPolicyRequest {