Skip to content

Commit 3365171

Browse files
Alias custom context in Postman Client (#4185)
This makes it clear which context we're using
1 parent 1c51106 commit 3365171

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

pkg/sources/postman/postman_client.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import (
1111
"golang.org/x/time/rate"
1212

1313
"github.com/trufflesecurity/trufflehog/v3/pkg/common"
14-
"github.com/trufflesecurity/trufflehog/v3/pkg/context"
14+
trContext "github.com/trufflesecurity/trufflehog/v3/pkg/context"
1515
"github.com/trufflesecurity/trufflehog/v3/pkg/pb/source_metadatapb"
1616
)
1717

@@ -258,7 +258,7 @@ func checkResponseStatus(r *http.Response) error {
258258
}
259259

260260
// getPostmanResponseBodyBytes makes a request to the Postman API and returns the response body as bytes.
261-
func (c *Client) getPostmanResponseBodyBytes(ctx context.Context, urlString string, headers map[string]string) ([]byte, error) {
261+
func (c *Client) getPostmanResponseBodyBytes(ctx trContext.Context, urlString string, headers map[string]string) ([]byte, error) {
262262
req, err := c.NewRequest(urlString, headers)
263263
if err != nil {
264264
return nil, err
@@ -305,7 +305,7 @@ func (c *Client) getPostmanResponseBodyBytes(ctx context.Context, urlString stri
305305

306306
// EnumerateWorkspaces returns the workspaces for a given user (both private, public, team and personal).
307307
// Consider adding additional flags to support filtering.
308-
func (c *Client) EnumerateWorkspaces(ctx context.Context) ([]Workspace, error) {
308+
func (c *Client) EnumerateWorkspaces(ctx trContext.Context) ([]Workspace, error) {
309309
ctx.Logger().V(2).Info("enumerating workspaces")
310310
workspacesObj := struct {
311311
Workspaces []Workspace `json:"workspaces"`
@@ -339,7 +339,7 @@ func (c *Client) EnumerateWorkspaces(ctx context.Context) ([]Workspace, error) {
339339
}
340340

341341
// GetWorkspace returns the workspace for a given workspace
342-
func (c *Client) GetWorkspace(ctx context.Context, workspaceUUID string) (Workspace, error) {
342+
func (c *Client) GetWorkspace(ctx trContext.Context, workspaceUUID string) (Workspace, error) {
343343
ctx.Logger().V(2).Info("getting workspace", "workspace", workspaceUUID)
344344
obj := struct {
345345
Workspace Workspace `json:"workspace"`
@@ -361,7 +361,7 @@ func (c *Client) GetWorkspace(ctx context.Context, workspaceUUID string) (Worksp
361361
}
362362

363363
// GetEnvironmentVariables returns the environment variables for a given environment
364-
func (c *Client) GetEnvironmentVariables(ctx context.Context, environment_uuid string) (VariableData, error) {
364+
func (c *Client) GetEnvironmentVariables(ctx trContext.Context, environment_uuid string) (VariableData, error) {
365365
ctx.Logger().V(3).Info("getting environment variables", "environment_uuid", environment_uuid)
366366
obj := struct {
367367
VariableData VariableData `json:"environment"`
@@ -383,7 +383,7 @@ func (c *Client) GetEnvironmentVariables(ctx context.Context, environment_uuid s
383383
}
384384

385385
// GetCollection returns the collection for a given collection
386-
func (c *Client) GetCollection(ctx context.Context, collection_uuid string) (Collection, error) {
386+
func (c *Client) GetCollection(ctx trContext.Context, collection_uuid string) (Collection, error) {
387387
ctx.Logger().V(3).Info("getting collection", "collection_uuid", collection_uuid)
388388
obj := struct {
389389
Collection Collection `json:"collection"`

0 commit comments

Comments
 (0)