remove unused config field from User
This commit is contained in:
parent
3f3278b73e
commit
08b2f5301f
@ -60,7 +60,6 @@ type User struct {
|
|||||||
ReadCommand *command.Command `json:"-" yaml:"-"`
|
ReadCommand *command.Command `json:"-" yaml:"-"`
|
||||||
UpdateCommand *command.Command `json:"-" yaml:"-"`
|
UpdateCommand *command.Command `json:"-" yaml:"-"`
|
||||||
DeleteCommand *command.Command `json:"-" yaml:"-"`
|
DeleteCommand *command.Command `json:"-" yaml:"-"`
|
||||||
config data.ConfigurationValueGetter
|
|
||||||
Resources data.ResourceMapper `json:"-" yaml:"-"`
|
Resources data.ResourceMapper `json:"-" yaml:"-"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -96,8 +95,9 @@ func FindSystemUserType() UserType {
|
|||||||
func (u *User) Init(uri data.URIParser) error {
|
func (u *User) Init(uri data.URIParser) error {
|
||||||
if uri == nil {
|
if uri == nil {
|
||||||
uri = folio.URI(u.URI()).Parse()
|
uri = folio.URI(u.URI()).Parse()
|
||||||
|
} else {
|
||||||
|
u.Name = uri.URL().Hostname()
|
||||||
}
|
}
|
||||||
u.Name = uri.URL().Hostname()
|
|
||||||
u.UID = LookupUIDString(uri.URL().Hostname())
|
u.UID = LookupUIDString(uri.URL().Hostname())
|
||||||
u.CreateCommand, u.ReadCommand, u.UpdateCommand, u.DeleteCommand = u.UserType.NewCRUD()
|
u.CreateCommand, u.ReadCommand, u.UpdateCommand, u.DeleteCommand = u.UserType.NewCRUD()
|
||||||
return u.SetParsedURI(uri)
|
return u.SetParsedURI(uri)
|
||||||
|
@ -94,7 +94,9 @@ func TestSystemUser(t *testing.T) {
|
|||||||
return nil, fmt.Errorf("%w: %s", data.ErrUnknownConfigurationKey, key)
|
return nil, fmt.Errorf("%w: %s", data.ErrUnknownConfigurationKey, key)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
assert.Nil(t, u.Init(nil))
|
||||||
u.ResolveId(context.Background())
|
u.ResolveId(context.Background())
|
||||||
|
|
||||||
assert.Equal(t, "bar", u.Name)
|
assert.Equal(t, "bar", u.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user