Skip to content

Commit 68fb5ee

Browse files
authored
Add function for getting creds of remote client (#2089)
This is needed while checking PutObject/DeleteObject permissions on bucket replicated remote targets to create admin client and invoke API. Signed-off-by: Shubhendu Ram Tripathi <[email protected]>
1 parent 1e5fd8a commit 68fb5ee

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

api.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1065,3 +1065,11 @@ func (c *Client) CredContext() *credentials.CredContext {
10651065
Endpoint: c.endpointURL.String(),
10661066
}
10671067
}
1068+
1069+
// GetCreds returns the access creds for the client
1070+
func (c *Client) GetCreds() (credentials.Value, error) {
1071+
if c.credsProvider == nil {
1072+
return credentials.Value{}, errors.New("no credentials provider")
1073+
}
1074+
return c.credsProvider.GetWithContext(c.CredContext())
1075+
}

0 commit comments

Comments
 (0)