Skip to content

Commit

Permalink
migrate-groups: add auth-type to identity
Browse files Browse the repository at this point in the history
add basic auth-type to identity for the groups migration script
FIXES: https://issues.redhat.com/browse/THEEDGE-3555
  • Loading branch information
ldjebran committed Nov 23, 2023
1 parent 4b1dd1c commit e655343
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cmd/migrategroups/migrategroups/migrategroups.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ var DefaultMaxDataPageNumber = 100
// DefaultIdentityType the default identity type used in header when requesting inventory groups end-point
var DefaultIdentityType = "System"

// AuthTypeBASIC the BASIC identity type used in header when requesting inventory groups end-point
var AuthTypeBASIC = "basic-auth"

// OrgsGroupsFilter the filter added to filter an organization groups (if the org_id is defined in the map as a key)
var OrgsGroupsFilter = map[string][]interface{}{
"11789772": {"device_groups.name LIKE ?", "%-Store-%"},
Expand All @@ -63,6 +66,7 @@ func newInventoryGroupsOrgClient(orgID string) (inventorygroups.ClientInterface,
ident := identity.XRHID{Identity: identity.Identity{
OrgID: orgID,
Type: DefaultIdentityType,
AuthType: AuthTypeBASIC,
Internal: identity.Internal{OrgID: orgID},
}}
jsonIdent, err := json.Marshal(&ident)
Expand Down
1 change: 1 addition & 0 deletions cmd/migrategroups/migrategroups/migrategroups_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ var _ = Describe("Migrate device groups", func() {
Expect(err).ToNot(HaveOccurred())
Expect(rhIndent.Identity.OrgID).To(Equal(orgID))
Expect(rhIndent.Identity.Type).To(Equal(migrategroups.DefaultIdentityType))
Expect(rhIndent.Identity.AuthType).To(Equal(migrategroups.AuthTypeBASIC))
return mockInventoryGroupClient
}

Expand Down

0 comments on commit e655343

Please sign in to comment.