user

package
v12.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 16, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Overview

Package user supports the resource artifactory_user and artifactory_managed_user, which use the new terraform-plugin-framework

The truth table below shows how extra logic is needed to accommodate the behavior of Artifactory API for users while maintaining backward compatibility with states created by SDKv2 provider.

Create | Config | Plan | PUT | POST | GET | State | |----------------|----------------|----------------|---------|----------------|----------------| | Not Defined | Null | | [] | | Null | | [] | [] | [] | [] | | [] | | ["readers"] | ["readers"] | ["readers"] | | ["readers"] | ["readers"] |

Update | Config | Plan | POST | GET | State | |-----------------------|-----------------------|-----------------------|-----------------------|-----------------------| | Not Defined | Null | | | Null | | [] | [] | [] | | [] | | ["readers", "foo"] | ["readers", "foo"] | ["readers", "foo"] | ["readers", "foo"] | ["readers", "foo"] |

Index

Constants

View Source
const (
	AccessAPIArtifactoryVersion = "7.84.3"
	UserGroupEndpointPath       = "access/api/v2/users/{name}/groups"
)

Variables

This section is empty.

Functions

func GetUserEndpointPath

func GetUserEndpointPath(artifactoryVersion string) string

func GetUsersEndpointPath

func GetUsersEndpointPath(artifactoryVersion string) string

func NewAnonymousUserResource

func NewAnonymousUserResource() resource.Resource

func NewManagedUserResource

func NewManagedUserResource() resource.Resource

func NewUnmanagedUserResource

func NewUnmanagedUserResource() resource.Resource

func NewUserResource

func NewUserResource() resource.Resource

Types

type ArtifactoryAnonymousUserResource

type ArtifactoryAnonymousUserResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ArtifactoryAnonymousUserResource) Configure

func (*ArtifactoryAnonymousUserResource) Create

func (*ArtifactoryAnonymousUserResource) Delete

func (*ArtifactoryAnonymousUserResource) ImportState

ImportState imports the resource into the Terraform state.

func (*ArtifactoryAnonymousUserResource) Metadata

func (*ArtifactoryAnonymousUserResource) Read

func (*ArtifactoryAnonymousUserResource) Schema

func (*ArtifactoryAnonymousUserResource) Update

type ArtifactoryAnonymousUserResourceAPIModel

type ArtifactoryAnonymousUserResourceAPIModel struct {
	Name string `json:"username"`
}

ArtifactoryAnonymousUserResourceAPIModel describes the API data model.

type ArtifactoryAnonymousUserResourceModel

type ArtifactoryAnonymousUserResourceModel struct {
	Id   types.String `tfsdk:"id"`
	Name types.String `tfsdk:"name"`
}

ArtifactoryAnonymousUserResourceModel describes the Terraform resource data model to match the resource schema.

type ArtifactoryBaseUserResource

type ArtifactoryBaseUserResource struct {
	ProviderData util.ProviderMetadata
	TypeName     string
}

func (*ArtifactoryBaseUserResource) Configure

func (*ArtifactoryBaseUserResource) Create

func (*ArtifactoryBaseUserResource) Delete

func (*ArtifactoryBaseUserResource) ImportState

ImportState imports the resource into the Terraform state.

func (*ArtifactoryBaseUserResource) Metadata

func (*ArtifactoryBaseUserResource) Read

func (*ArtifactoryBaseUserResource) Update

func (*ArtifactoryBaseUserResource) UpgradeState

func (ArtifactoryBaseUserResource) ValidateConfig

type ArtifactoryManagedUserResource

type ArtifactoryManagedUserResource struct {
	ArtifactoryBaseUserResource
}

func (*ArtifactoryManagedUserResource) Schema

type ArtifactoryUserAPIModel

type ArtifactoryUserAPIModel struct {
	Name                     string    `json:"name"`
	Email                    string    `json:"email"`
	Password                 string    `json:"password,omitempty"`
	Admin                    bool      `json:"admin"`
	ProfileUpdatable         bool      `json:"profileUpdatable"`
	DisableUIAccess          bool      `json:"disableUIAccess"`
	InternalPasswordDisabled *bool     `json:"internalPasswordDisabled"`
	Groups                   *[]string `json:"groups,omitempty"`
}

ArtifactoryUserAPIModel corresponds to old Artifactory user API

type ArtifactoryUserResource

type ArtifactoryUserResource struct {
	ArtifactoryBaseUserResource
}

func (*ArtifactoryUserResource) Schema

type ArtifactoryUserResourceAPIModel

type ArtifactoryUserResourceAPIModel struct {
	Name                     string    `json:"username"`
	Email                    string    `json:"email"`
	Password                 string    `json:"password,omitempty"`
	Admin                    bool      `json:"admin"`
	ProfileUpdatable         bool      `json:"profile_updatable"`
	DisableUIAccess          bool      `json:"disable_ui_access"`
	InternalPasswordDisabled *bool     `json:"internal_password_disabled,omitempty"`
	Groups                   *[]string `json:"groups,omitempty"`
}

ArtifactoryUserResourceAPIModel describes the API data model.

func (ArtifactoryUserResourceAPIModel) ToState

type ArtifactoryUserResourceModel

type ArtifactoryUserResourceModel struct {
	Id                       types.String `tfsdk:"id"`
	Name                     types.String `tfsdk:"name"`
	Email                    types.String `tfsdk:"email"`
	Password                 types.String `tfsdk:"password"`
	PasswordPolicy           types.Object `tfsdk:"password_policy"`
	Admin                    types.Bool   `tfsdk:"admin"`
	ProfileUpdatable         types.Bool   `tfsdk:"profile_updatable"`
	DisableUIAccess          types.Bool   `tfsdk:"disable_ui_access"`
	InternalPasswordDisabled types.Bool   `tfsdk:"internal_password_disabled"`
	Groups                   types.Set    `tfsdk:"groups"`
}

type ArtifactoryUserResourceModelV0

type ArtifactoryUserResourceModelV0 struct {
	Id                       types.String `tfsdk:"id"`
	Name                     types.String `tfsdk:"name"`
	Email                    types.String `tfsdk:"email"`
	Password                 types.String `tfsdk:"password"`
	Admin                    types.Bool   `tfsdk:"admin"`
	ProfileUpdatable         types.Bool   `tfsdk:"profile_updatable"`
	DisableUIAccess          types.Bool   `tfsdk:"disable_ui_access"`
	InternalPasswordDisabled types.Bool   `tfsdk:"internal_password_disabled"`
	Groups                   types.Set    `tfsdk:"groups"`
}

ArtifactoryUserResourceModel describes the Terraform resource data model to match the resource schema.

type GroupsAddRemove

type GroupsAddRemove struct {
	Add    []string `json:"add"`
	Remove []string `json:"remove"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL