Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
postman_client.IDNameUUID becomes IdNameUid (#4123)
Martin Locklear513d4ac0c8c4
diff --git a/pkg/sources/postman/postman.go b/pkg/sources/postman/postman.goindex 2151f4904..a499b12c9 100644--- a/pkg/sources/postman/postman.go+++ b/pkg/sources/postman/postman.go@@ -266,18 +266,18 @@ func (s *Source) scanWorkspace(ctx context.Context, chunksChan chan *sources.Chu// gather and scan environment variablesfor _, envID := range workspace.Environments {- envVars, err := s.client.GetEnvironmentVariables(ctx, envID.UUID)+ envVars, err := s.client.GetEnvironmentVariables(ctx, envID.Uid)if err != nil {- ctx.Logger().Error(err, "could not get env variables", "environment_uuid", envID.UUID)+ ctx.Logger().Error(err, "could not get env variables", "environment_uuid", envID.Uid)continue}- if shouldSkip(envID.UUID, s.conn.IncludeEnvironments, s.conn.ExcludeEnvironments) {+ if shouldSkip(envID.Uid, s.conn.IncludeEnvironments, s.conn.ExcludeEnvironments) {continue}metadata.Type = ENVIRONMENT_TYPE- metadata.Link = LINK_BASE_URL + "environments/" + envID.UUID+ metadata.Link = LINK_BASE_URL + "environments/" + envID.Uidmetadata.FullID = envVars.ID- metadata.EnvironmentID = envID.UUID+ metadata.EnvironmentID = envID.Uidmetadata.EnvironmentName = envVars.Namectx.Logger().V(2).Info("scanning environment vars", "environment_uuid", metadata.FullID)@@ -300,10 +300,10 @@ func (s *Source) scanWorkspace(ctx context.Context, chunksChan chan *sources.Chu// at this point we have all the possible// substitutions from Environment variablesfor _, collectionID := range workspace.Collections {- if shouldSkip(collectionID.UUID, s.conn.IncludeCollections, s.conn.ExcludeCollections) {+ if shouldSkip(collectionID.Uid, s.conn.IncludeCollections, s.conn.ExcludeCollections) {continue}- collection, err := s.client.GetCollection(ctx, collectionID.UUID)+ collection, err := s.client.GetCollection(ctx, collectionID.Uid)if err != nil {// Log and move on, because sometimes the Postman API seems to give us collection IDs// that we don't have access to, so we don't want to kill the scan because of it.diff --git a/pkg/sources/postman/postman_client.go b/pkg/sources/postman/postman_client.goindex b82655136..87f26f9f8 100644--- a/pkg/sources/postman/postman_client.go+++ b/pkg/sources/postman/postman_client.go@@ -22,25 +22,25 @@ const ()type Workspace struct {- ID string `json:"id"`- Name string `json:"name"`- Type string `json:"type"`- Description string `json:"description"`- Visibility string `json:"visibility"`- CreatedBy string `json:"createdBy"`- UpdatedBy string `json:"updatedBy"`- CreatedAt string `json:"createdAt"`- UpdatedAt string `json:"updatedAt"`- Collections []IDNameUUID `json:"collections"`- Environments []IDNameUUID `json:"environments"`+ ID string `json:"id"`+ Name string `json:"name"`+ Type string `json:"type"`+ Description string `json:"description"`+ Visibility string `json:"visibility"`+ CreatedBy string `json:"createdBy"`+ UpdatedBy string `json:"updatedBy"`+ CreatedAt string `json:"createdAt"`+ UpdatedAt string `json:"updatedAt"`+ Collections []IdNameUid `json:"collections"`+ Environments []IdNameUid `json:"environments"`CollectionsRaw []CollectionEnvironmentsRaw []VariableData}-type IDNameUUID struct {+type IdNameUid struct {ID string `json:"id"`Name string `json:"name"`- UUID string `json:"uid"`+ Uid string `json:"uid"`}type KeyValue struct {