Skip to content

Commit

Permalink
client: Add the passed host to the signer
Browse files Browse the repository at this point in the history
Currently the request will only be signed if it's to one of the
components' addresses (intra-component comms). We also need to allow
external requests by clairctl to be signed using the key they pass
implicitly from the config.

Signed-off-by: crozzy <joseph.crosland@gmail.com>
  • Loading branch information
crozzy committed Jan 12, 2023
1 parent adbaa56 commit ddea858
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/clairctl/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func deleteAction(c *cli.Context) error {
if err != nil {
return err
}
if err = s.Add(ctx, c.String("host")); err != nil {
return err
}

}
cc, err := NewClient(hc, c.String("host"), s)
if err != nil {
Expand Down
3 changes: 3 additions & 0 deletions cmd/clairctl/report.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,9 @@ func reportAction(c *cli.Context) error {
if err != nil {
return err
}
if err = s.Add(ctx, c.String("host")); err != nil {
return err
}
}
cc, err := NewClient(hc, c.String("host"), s)
if err != nil {
Expand Down

0 comments on commit ddea858

Please sign in to comment.