Skip to content

Commit

Permalink
chore(group): changed auth domain to user managment
Browse files Browse the repository at this point in the history
  • Loading branch information
NSSPKrishna authored and pranav-new-relic committed Dec 27, 2023
1 parent 27b6618 commit 78bcc46
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 24 deletions.
4 changes: 1 addition & 3 deletions .tutone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ packages:
- github.com/newrelic/newrelic-client-go/v2/pkg/nrtime
- github.com/newrelic/newrelic-client-go/v2/pkg/users
queries:
- path: ["actor", "organization", "authorizationManagement", "authenticationDomains"]
- path: ["actor", "organization", "userManagement", "authenticationDomains"]
endpoints:
- name: authenticationDomains
max_query_field_depth: 4
Expand All @@ -131,8 +131,6 @@ packages:
- name: DateTime
field_type_override: nrtime.DateTime
skip_type_create: true
- name: UserManagementGroupUsers
field_type_override: "*UserManagementGroupUsers"

- name: logconfigurations
path: pkg/logconfigurations
Expand Down
5 changes: 1 addition & 4 deletions pkg/usermanagement/group_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ import (

func TestIntegrationGroup(t *testing.T) {
t.Parallel()
//accountID, err := mock.GetTestAccountID()
//if err != nil {
// t.Skipf("%s", err)
//}

var (
rand = mock.RandSeq(5)
testName = "test_" + rand
Expand Down
7 changes: 7 additions & 0 deletions pkg/usermanagement/group_managment_unit_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,13 @@ func TestCreateGroup(t *testing.T) {
assert.Equal(t, expected, actual)
}

func TestReadGroup(t *testing.T) {
t.Parallel()
respJSON := fmt.Sprintf(`{ "data":%s }`, testReadGroupResponseJson)

Check failure on line 86 in pkg/usermanagement/group_managment_unit_test.go

View workflow job for this annotation

GitHub Actions / test-unit

undefined: testReadGroupResponseJson

Check failure on line 86 in pkg/usermanagement/group_managment_unit_test.go

View workflow job for this annotation

GitHub Actions / test-unit

undefined: testReadGroupResponseJson
user := newMockResponse(t, respJSON, http.StatusCreated)

Check failure on line 87 in pkg/usermanagement/group_managment_unit_test.go

View workflow job for this annotation

GitHub Actions / test-unit

user declared but not used

Check failure on line 87 in pkg/usermanagement/group_managment_unit_test.go

View workflow job for this annotation

GitHub Actions / test-unit

user declared but not used
id := "66cdd38c-45a2-4106-95a0-8198f5cff775"

Check failure on line 88 in pkg/usermanagement/group_managment_unit_test.go

View workflow job for this annotation

GitHub Actions / test-unit

id declared but not used

Check failure on line 88 in pkg/usermanagement/group_managment_unit_test.go

View workflow job for this annotation

GitHub Actions / test-unit

id declared but not used
}

func TestUpdateGroup(t *testing.T) {
t.Parallel()
respJSON := fmt.Sprintf(`{ "data":%s }`, testUpdateGroupResponseJSON)
Expand Down
18 changes: 9 additions & 9 deletions pkg/usermanagement/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,22 +98,16 @@ type AuthorizationManagementGroupSearch struct {
TotalCount int `json:"totalCount"`
}

// AuthorizationManagementOrganizationStitchedFields -
type AuthorizationManagementOrganizationStitchedFields struct {
// list of authentication domains
AuthenticationDomains AuthorizationManagementAuthenticationDomainSearch `json:"authenticationDomains,omitempty"`
}

// Organization - The `Organization` object provides basic data about an organization.
type Organization struct {
// This field provides access to AuthorizationManagement data.
AuthorizationManagement AuthorizationManagementOrganizationStitchedFields `json:"authorizationManagement,omitempty"`
// The customer id for the organization.
CustomerId string `json:"customerId,omitempty"`
// The name of the organization.
Name string `json:"name,omitempty"`
// The telemetry id for the organization
TelemetryId string `json:"telemetryId,omitempty"`
// This field provides access to UserManagement data.
UserManagement UserManagementOrganizationStitchedFields `json:"userManagement,omitempty"`
}

// UserManagementAuthenticationDomain - An "authentication domain" is a grouping of New Relic users governed by the same user management settings, like how they're provisioned (added and updated), how they're authenticated (logged in), session settings, and how user upgrades are managed.
Expand Down Expand Up @@ -223,7 +217,7 @@ type UserManagementGroup struct {
// a value that uniquely identifies this object
ID string `json:"id"`
// container for users enabling cursor based pagination
Users *UserManagementGroupUsers `json:"users,omitempty"`
Users UserManagementGroupUsers `json:"users,omitempty"`
}

// UserManagementGroupUser - User information returned within Groups
Expand Down Expand Up @@ -258,6 +252,12 @@ type UserManagementGroups struct {
TotalCount int `json:"totalCount"`
}

// UserManagementOrganizationStitchedFields -
type UserManagementOrganizationStitchedFields struct {
// An "authentication domain" is a grouping of New Relic users governed by the same user management settings, like how they're provisioned (added and updated), how they're authenticated (logged in), session settings, and how user upgrades are managed.
AuthenticationDomains UserManagementAuthenticationDomains `json:"authenticationDomains,omitempty"`
}

// UserManagementUpdateGroup - The input object representing the group being updated
type UserManagementUpdateGroup struct {
// The name of the group
Expand Down
15 changes: 8 additions & 7 deletions pkg/usermanagement/usermanagement_api.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/usermanagement/usermanagement_int_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (

func TestIntegrationCreateWorkflow(t *testing.T) {
t.Parallel()
accountID, err := mock.GetTestAccountID()
_, err := mock.GetTestAccountID()
if err != nil {
t.Skipf("%s", err)
}
Expand Down

0 comments on commit 78bcc46

Please sign in to comment.