Require access to Still via method

This commit adds a safeguard to accessing the still from a specific
component by requiring access via the component.GetStill method.
This commit is contained in:
Tom Wiesing 2024-04-08 22:39:32 +02:00
parent 81fa84c244
commit 8235ea9105
No known key found for this signature in database
63 changed files with 288 additions and 197 deletions

View file

@ -18,7 +18,8 @@ var (
)
func (ssh *SSH) Keys(ctx context.Context) (keys []ssh.PublicKey, err error) {
grants, err := ssh.Liquid.Policy.Instance(ctx, ssh.Slug)
liquid := ingredient.GetLiquid(ssh)
grants, err := liquid.Policy.Instance(ctx, liquid.Slug)
if err != nil {
return nil, err
}
@ -28,7 +29,7 @@ func (ssh *SSH) Keys(ctx context.Context) (keys []ssh.PublicKey, err error) {
if !grant.DrupalAdminRole {
continue
}
ukeys, err := ssh.Liquid.Keys.Keys(ctx, grant.User)
ukeys, err := liquid.Keys.Keys(ctx, grant.User)
if err != nil {
return nil, err
}
@ -50,7 +51,7 @@ func (ssh *SSH) AllKeys(ctx context.Context) (keys []ssh.PublicKey, err error) {
return nil, err
}
gkeys, err := ssh.Liquid.Keys.Admin(ctx)
gkeys, err := ingredient.GetLiquid(ssh).Keys.Admin(ctx)
if err != nil {
return nil, err
}