user

package
v10.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: Apache-2.0 Imports: 31 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 UserEndpointPath = "access/api/v2/users/{name}"
View Source
const UserGroupEndpointPath = "access/api/v2/users/{name}/groups"
View Source
const UsersEndpointPath = "access/api/v2/users"

Variables

This section is empty.

Functions

func NewAnonymousUserResource

func NewAnonymousUserResource() resource.Resource

func NewManagedUserResource

func NewManagedUserResource() resource.Resource

func NewUserResource

func NewUserResource() resource.Resource

func PackUser

func PackUser(user User, d *schema.ResourceData) diag.Diagnostics

func ResourceArtifactoryUser

func ResourceArtifactoryUser() *schema.Resource

Types

type ArtifactoryAnonymousUserResource

type ArtifactoryAnonymousUserResource struct {
	ProviderData util.ProvderMetadata
	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.ProvderMetadata
	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

type ArtifactoryManagedUserResource

type ArtifactoryManagedUserResource struct {
	ArtifactoryBaseUserResource
}

func (*ArtifactoryManagedUserResource) Schema

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"`
	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"`
	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 added in v10.3.2

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

type User

type User 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"`
	Groups                   []string `json:"groups,omitempty"`
}

Jump to

Keyboard shortcuts

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