2020-08-13 12:43:47 +00:00
|
|
|
package acl
|
2020-08-12 19:06:10 +00:00
|
|
|
|
|
|
|
import (
|
2023-03-07 10:38:56 +00:00
|
|
|
refs "git.frostfs.info/TrueCloudLab/frostfs-api-go/v2/refs/grpc"
|
2020-08-12 19:06:10 +00:00
|
|
|
)
|
|
|
|
|
2020-09-04 07:50:09 +00:00
|
|
|
// SetVersion sets version of EACL rules in table.
|
|
|
|
func (m *EACLTable) SetVersion(v *refs.Version) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Version = v
|
2020-09-04 07:50:09 +00:00
|
|
|
}
|
|
|
|
|
2020-08-12 19:06:10 +00:00
|
|
|
// SetContainerId sets container identifier of the eACL table.
|
|
|
|
func (m *EACLTable) SetContainerId(v *refs.ContainerID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.ContainerId = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetRecords sets record list of the eACL table.
|
|
|
|
func (m *EACLTable) SetRecords(v []*EACLRecord) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Records = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetOperation sets operation of the eACL record.
|
2020-08-17 11:30:09 +00:00
|
|
|
func (m *EACLRecord) SetOperation(v Operation) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Operation = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetAction sets action of the eACL record.
|
2020-08-17 11:30:09 +00:00
|
|
|
func (m *EACLRecord) SetAction(v Action) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Action = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetFilters sets filter list of the eACL record.
|
2020-09-04 07:50:09 +00:00
|
|
|
func (m *EACLRecord) SetFilters(v []*EACLRecord_Filter) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Filters = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetTargets sets target list of the eACL record.
|
2020-09-04 07:50:09 +00:00
|
|
|
func (m *EACLRecord) SetTargets(v []*EACLRecord_Target) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Targets = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetHeader sets header type of the eACL filter.
|
2020-09-04 07:50:09 +00:00
|
|
|
func (m *EACLRecord_Filter) SetHeader(v HeaderType) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.HeaderType = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetMatchType sets match type of the eACL filter.
|
2020-09-04 07:50:09 +00:00
|
|
|
func (m *EACLRecord_Filter) SetMatchType(v MatchType) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.MatchType = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-10-27 13:55:19 +00:00
|
|
|
// SetKey sets key of the eACL filter.
|
|
|
|
func (m *EACLRecord_Filter) SetKey(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Key = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-10-27 13:55:19 +00:00
|
|
|
// SetValue sets value of the eACL filter.
|
|
|
|
func (m *EACLRecord_Filter) SetValue(v string) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Value = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-09-04 07:50:09 +00:00
|
|
|
// SetRole sets target group of the eACL target.
|
|
|
|
func (m *EACLRecord_Target) SetRole(v Role) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Role = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
|
|
|
|
2020-10-19 12:39:13 +00:00
|
|
|
// SetKeys of the eACL target.
|
|
|
|
func (m *EACLRecord_Target) SetKeys(v [][]byte) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Keys = v
|
2020-08-12 19:06:10 +00:00
|
|
|
}
|
2020-08-20 10:07:35 +00:00
|
|
|
|
|
|
|
// SetEaclTable sets eACL table of the bearer token.
|
|
|
|
func (m *BearerToken_Body) SetEaclTable(v *EACLTable) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.EaclTable = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetOwnerId sets identifier of the bearer token owner.
|
|
|
|
func (m *BearerToken_Body) SetOwnerId(v *refs.OwnerID) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.OwnerId = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetLifetime sets lifetime of the bearer token.
|
|
|
|
func (m *BearerToken_Body) SetLifetime(v *BearerToken_Body_TokenLifetime) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Lifetime = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetBody sets bearer token body.
|
|
|
|
func (m *BearerToken) SetBody(v *BearerToken_Body) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Body = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetSignature sets bearer token signature.
|
|
|
|
func (m *BearerToken) SetSignature(v *refs.Signature) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Signature = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetExp sets epoch number of the token expiration.
|
|
|
|
func (m *BearerToken_Body_TokenLifetime) SetExp(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Exp = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetNbf sets starting epoch number of the token.
|
|
|
|
func (m *BearerToken_Body_TokenLifetime) SetNbf(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Nbf = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// SetIat sets the number of the epoch in which the token was issued.
|
|
|
|
func (m *BearerToken_Body_TokenLifetime) SetIat(v uint64) {
|
2022-03-23 11:42:57 +00:00
|
|
|
m.Iat = v
|
2020-08-20 10:07:35 +00:00
|
|
|
}
|
2021-06-18 12:27:01 +00:00
|
|
|
|
|
|
|
// FromString parses Action from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *Action) FromString(s string) bool {
|
|
|
|
i, ok := Action_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = Action(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses Role from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *Role) FromString(s string) bool {
|
|
|
|
i, ok := Role_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = Role(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses Operation from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *Operation) FromString(s string) bool {
|
|
|
|
i, ok := Operation_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = Operation(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses MatchType from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *MatchType) FromString(s string) bool {
|
|
|
|
i, ok := MatchType_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = MatchType(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|
|
|
|
|
|
|
|
// FromString parses HeaderType from a string representation,
|
|
|
|
// It is a reverse action to String().
|
|
|
|
//
|
|
|
|
// Returns true if s was parsed successfully.
|
|
|
|
func (x *HeaderType) FromString(s string) bool {
|
|
|
|
i, ok := HeaderType_value[s]
|
|
|
|
if ok {
|
|
|
|
*x = HeaderType(i)
|
|
|
|
}
|
|
|
|
|
|
|
|
return ok
|
|
|
|
}
|