Skip to content

Latest commit

 

History

History
341 lines (219 loc) · 9.68 KB

File metadata and controls

341 lines (219 loc) · 9.68 KB

\SecurityManagementSAMLUsersAPI

All URIs are relative to /service/rest

Method HTTP request Description
CreateSecuritySamlUsers Post /v1/security/saml/users Create a new SAML user. This allows administrators to pre-create SAML users with roles before their first login.
DeleteSecuritySamlUsers Delete /v1/security/saml/users/{userId} Delete a SAML user.
GetSecuritySamlUsers Get /v1/security/saml/users/{userId} Retrieve a SAML user by userId.
ListSecuritySamlUsers Get /v1/security/saml/users Retrieve a list of SAML users. The response is limited to 1,000 users.
UpdateSecuritySamlUsers Put /v1/security/saml/users/{userId} Update a SAML user's roles and attributes.

CreateSecuritySamlUsers

CreateSecuritySamlUsers(ctx).SamlUserXO(samlUserXO).Execute()

Create a new SAML user. This allows administrators to pre-create SAML users with roles before their first login.

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)

func main() {
	samlUserXO := *sonatyperepo.NewSamlUserXO("Status_example", "UserId_example") // SamlUserXO | The SAML user to create

	configuration := sonatyperepo.NewConfiguration()
	apiClient := sonatyperepo.NewAPIClient(configuration)
	r, err := apiClient.SecurityManagementSAMLUsersAPI.CreateSecuritySamlUsers(context.Background()).SamlUserXO(samlUserXO).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementSAMLUsersAPI.CreateSecuritySamlUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiCreateSecuritySamlUsersRequest struct via the builder pattern

Name Type Description Notes
samlUserXO SamlUserXO The SAML user to create

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeleteSecuritySamlUsers

DeleteSecuritySamlUsers(ctx, userId).Execute()

Delete a SAML user.

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)

func main() {
	userId := "userId_example" // string | The userid the request should apply to.

	configuration := sonatyperepo.NewConfiguration()
	apiClient := sonatyperepo.NewAPIClient(configuration)
	r, err := apiClient.SecurityManagementSAMLUsersAPI.DeleteSecuritySamlUsers(context.Background(), userId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementSAMLUsersAPI.DeleteSecuritySamlUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string The userid the request should apply to.

Other Parameters

Other parameters are passed through a pointer to a apiDeleteSecuritySamlUsersRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetSecuritySamlUsers

SamlUserXO GetSecuritySamlUsers(ctx, userId).Execute()

Retrieve a SAML user by userId.

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)

func main() {
	userId := "userId_example" // string | The userid the request should apply to.

	configuration := sonatyperepo.NewConfiguration()
	apiClient := sonatyperepo.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityManagementSAMLUsersAPI.GetSecuritySamlUsers(context.Background(), userId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementSAMLUsersAPI.GetSecuritySamlUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `GetSecuritySamlUsers`: SamlUserXO
	fmt.Fprintf(os.Stdout, "Response from `SecurityManagementSAMLUsersAPI.GetSecuritySamlUsers`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string The userid the request should apply to.

Other Parameters

Other parameters are passed through a pointer to a apiGetSecuritySamlUsersRequest struct via the builder pattern

Name Type Description Notes

Return type

SamlUserXO

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

ListSecuritySamlUsers

[]SamlUserXO ListSecuritySamlUsers(ctx).UserId(userId).Execute()

Retrieve a list of SAML users. The response is limited to 1,000 users.

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)

func main() {
	userId := "userId_example" // string | An optional term to search userids for. (optional)

	configuration := sonatyperepo.NewConfiguration()
	apiClient := sonatyperepo.NewAPIClient(configuration)
	resp, r, err := apiClient.SecurityManagementSAMLUsersAPI.ListSecuritySamlUsers(context.Background()).UserId(userId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementSAMLUsersAPI.ListSecuritySamlUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `ListSecuritySamlUsers`: []SamlUserXO
	fmt.Fprintf(os.Stdout, "Response from `SecurityManagementSAMLUsersAPI.ListSecuritySamlUsers`: %v\n", resp)
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiListSecuritySamlUsersRequest struct via the builder pattern

Name Type Description Notes
userId string An optional term to search userids for.

Return type

[]SamlUserXO

Authorization

BasicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UpdateSecuritySamlUsers

UpdateSecuritySamlUsers(ctx, userId).SamlUserXO(samlUserXO).Execute()

Update a SAML user's roles and attributes.

Example

package main

import (
	"context"
	"fmt"
	"os"
	sonatyperepo "github.com/sonatype-nexus-community/nexus-repo-api-client-go/v395"
)

func main() {
	userId := "userId_example" // string | The userid the request should apply to.
	samlUserXO := *sonatyperepo.NewSamlUserXO("Status_example", "UserId_example") // SamlUserXO | The SAML user to update

	configuration := sonatyperepo.NewConfiguration()
	apiClient := sonatyperepo.NewAPIClient(configuration)
	r, err := apiClient.SecurityManagementSAMLUsersAPI.UpdateSecuritySamlUsers(context.Background(), userId).SamlUserXO(samlUserXO).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `SecurityManagementSAMLUsersAPI.UpdateSecuritySamlUsers``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
userId string The userid the request should apply to.

Other Parameters

Other parameters are passed through a pointer to a apiUpdateSecuritySamlUsersRequest struct via the builder pattern

Name Type Description Notes

samlUserXO | SamlUserXO | The SAML user to update |

Return type

(empty response body)

Authorization

BasicAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]