Skip to content

Commit

Permalink
eosclientbinary: add eos label (#3778)
Browse files Browse the repository at this point in the history
  • Loading branch information
labkode authored Apr 11, 2023
1 parent 909d369 commit 545a88c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions changelog/unreleased/eosbinary-tag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Enhancement: Add support to tag eos traffic

We've added support to tag eos traffic

https://github.com/cs3org/reva/pull/3778
7 changes: 5 additions & 2 deletions pkg/eosclient/eosbinary/eosbinary.go
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,9 @@ func (c *Client) executeEOS(ctx context.Context, cmdArgs []string, auth eosclien

cmd.Args = append(cmd.Args, cmdArgs...)

// add application label
cmd.Args = append(cmd.Args, "-a", "reva_eosclient::meta")

span := trace.SpanFromContext(ctx)
cmd.Args = append(cmd.Args, "--comment", span.SpanContext().TraceID().String())

Expand Down Expand Up @@ -740,7 +743,7 @@ func (c *Client) Read(ctx context.Context, auth eosclient.Authorization, path st
if auth.Token != "" {
args[3] += "?authz=" + auth.Token
} else if auth.Role.UID != "" && auth.Role.GID != "" {
args = append(args, fmt.Sprintf("-OSeos.ruid=%s&eos.rgid=%s", auth.Role.UID, auth.Role.GID))
args = append(args, fmt.Sprintf("-OSeos.ruid=%s&eos.rgid=%s&eos.app=reva_eosclient::read", auth.Role.UID, auth.Role.GID))
}

_, _, err := c.executeXRDCopy(ctx, args)
Expand Down Expand Up @@ -776,7 +779,7 @@ func (c *Client) WriteFile(ctx context.Context, auth eosclient.Authorization, pa
if auth.Token != "" {
args[4] += "?authz=" + auth.Token
} else if auth.Role.UID != "" && auth.Role.GID != "" {
args = append(args, fmt.Sprintf("-ODeos.ruid=%s&eos.rgid=%s", auth.Role.UID, auth.Role.GID))
args = append(args, fmt.Sprintf("-ODeos.ruid=%s&eos.rgid=%s&eos.app=reva_eosclient::write", auth.Role.UID, auth.Role.GID))
}

_, _, err := c.executeXRDCopy(ctx, args)
Expand Down

0 comments on commit 545a88c

Please sign in to comment.