Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drop tenant ID from path in Microsoft Graph requests #230

Merged
merged 5 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func main() {
log.Fatal(err)
}

client := msgraph.NewUsersClient(tenantId)
client := msgraph.NewUsersClient()
client.BaseClient.Authorizer = authorizer

users, _, err := client.List(ctx, odata.Query{})
Expand Down
2 changes: 1 addition & 1 deletion example/example.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func main() {
log.Fatal(err)
}

client := msgraph.NewUsersClient(tenantId)
client := msgraph.NewUsersClient()
client.BaseClient.Authorizer = authorizer

users, _, err := client.List(ctx, odata.Query{})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupAccessPackageAssignmentPolicies() {
client := msgraph.NewAccessPackageAssignmentPolicyClient(tenantId)
client := msgraph.NewAccessPackageAssignmentPolicyClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func cleanupAccessPackageAssignmentRequests() {
client := msgraph.NewAccessPackageAssignmentRequestClient(tenantId)
client := msgraph.NewAccessPackageAssignmentRequestClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/accesspackagecatalogs.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

func cleanupAccessPackageCatalogs() {
client := msgraph.NewAccessPackageCatalogClient(tenantId)
client := msgraph.NewAccessPackageCatalogClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/accesspackages.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupAccessPackages() {
client := msgraph.NewAccessPackageClient(tenantId)
client := msgraph.NewAccessPackageClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/administrativeunits.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupAdministrativeUnits() {
administrativeUnitsClient := msgraph.NewAdministrativeUnitsClient(tenantId)
administrativeUnitsClient := msgraph.NewAdministrativeUnitsClient()
administrativeUnitsClient.BaseClient.Authorizer = authorizer

administrativeUnits, _, err := administrativeUnitsClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/applications.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupApplications() {
appsClient := msgraph.NewApplicationsClient(tenantId)
appsClient := msgraph.NewApplicationsClient()
appsClient.BaseClient.Authorizer = authorizer

apps, _, err := appsClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/b2c_userflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupB2CUserFlows() {
client := msgraph.NewB2CUserFlowClient(b2cTenantId)
client := msgraph.NewB2CUserFlowClient()
client.BaseClient.Authorizer = b2cAuthorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(id, 'B2C_1_%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/claimsmappingpolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupClaimsMappingPolicies() {
client := msgraph.NewClaimsMappingPolicyClient(tenantId)
client := msgraph.NewClaimsMappingPolicyClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/conditionalaccesspolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupConditionalAccessPolicies() {
conditionalAccessPoliciesClient := msgraph.NewConditionalAccessPoliciesClient(tenantId)
conditionalAccessPoliciesClient := msgraph.NewConditionalAccessPoliciesClient()
conditionalAccessPoliciesClient.BaseClient.Authorizer = authorizer

conditionalAccessPolicies, _, err := conditionalAccessPoliciesClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/connectedorganizations.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupConnectedOrganizations() {
client := msgraph.NewConnectedOrganizationClient(tenantId)
client := msgraph.NewConnectedOrganizationClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/groups.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupGroups() {
groupsClient := msgraph.NewGroupsClient(tenantId)
groupsClient := msgraph.NewGroupsClient()
groupsClient.BaseClient.Authorizer = authorizer

groups, _, err := groupsClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/namedlocations.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupNamedLocations() {
namedLocationsClient := msgraph.NewNamedLocationsClient(tenantId)
namedLocationsClient := msgraph.NewNamedLocationsClient()
namedLocationsClient.BaseClient.Authorizer = authorizer

namedLocations, _, err := namedLocationsClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/roledefinitions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupRoleDefinitions() {
client := msgraph.NewRoleDefinitionsClient(tenantId)
client := msgraph.NewRoleDefinitionsClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/schemaextensions.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupSchemaExtensions() {
schemaExtensionsClient := msgraph.NewSchemaExtensionsClient(tenantId)
schemaExtensionsClient := msgraph.NewSchemaExtensionsClient()
schemaExtensionsClient.BaseClient.Authorizer = authorizer

schemaExtensions, _, err := schemaExtensionsClient.List(ctx, odata.Query{Filter: fmt.Sprintf("status eq '%s'", msgraph.SchemaExtensionStatusInDevelopment)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/serviceprincipals.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupServicePrincipals() {
servicePrincipalsClient := msgraph.NewServicePrincipalsClient(tenantId)
servicePrincipalsClient := msgraph.NewServicePrincipalsClient()
servicePrincipalsClient.BaseClient.Authorizer = authorizer

servicePrincipals, _, err := servicePrincipalsClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/termsofuse.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
)

func cleanupTermsOfUseAgreements() {
client := msgraph.NewTermsOfUseAgreementClient(tenantId)
client := msgraph.NewTermsOfUseAgreementClient()
client.BaseClient.Authorizer = authorizer

result, _, err := client.List(ctx, fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix))
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/test-cleanup/users.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
)

func cleanupUsers() {
usersClient := msgraph.NewUsersClient(tenantId)
usersClient := msgraph.NewUsersClient()
usersClient.BaseClient.Authorizer = authorizer

users, _, err := usersClient.List(ctx, odata.Query{Filter: fmt.Sprintf("startsWith(displayName, '%s')", displayNamePrefix)})
Expand Down
Loading