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
- func GetUserEndpointPath(artifactoryVersion string) string
- func GetUsersEndpointPath(artifactoryVersion string) string
- func NewAnonymousUserResource() resource.Resource
- func NewManagedUserResource() resource.Resource
- func NewUnmanagedUserResource() resource.Resource
- func NewUserResource() resource.Resource
- type ArtifactoryAnonymousUserResource
- func (r *ArtifactoryAnonymousUserResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ArtifactoryAnonymousUserResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ArtifactoryAnonymousUserResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ArtifactoryAnonymousUserResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ArtifactoryAnonymousUserResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ArtifactoryAnonymousUserResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ArtifactoryAnonymousUserResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ArtifactoryAnonymousUserResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ArtifactoryAnonymousUserResourceAPIModel
- type ArtifactoryAnonymousUserResourceModel
- type ArtifactoryBaseUserResource
- func (r *ArtifactoryBaseUserResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ArtifactoryBaseUserResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ArtifactoryBaseUserResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ArtifactoryBaseUserResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ArtifactoryBaseUserResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ArtifactoryBaseUserResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ArtifactoryBaseUserResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ArtifactoryManagedUserResource
- type ArtifactoryUserAPIModel
- type ArtifactoryUserResource
- type ArtifactoryUserResourceAPIModel
- type ArtifactoryUserResourceModel
- type GroupsAddRemove
Constants ¶
const ( AccessAPIArtifactoryVersion = "7.84.3" UserGroupEndpointPath = "access/api/v2/users/{name}/groups" )
Variables ¶
This section is empty.
Functions ¶
func GetUserEndpointPath ¶ added in v10.4.3
func GetUsersEndpointPath ¶ added in v10.4.3
func NewManagedUserResource ¶
func NewUnmanagedUserResource ¶ added in v10.7.1
func NewUserResource ¶
Types ¶
type ArtifactoryAnonymousUserResource ¶
type ArtifactoryAnonymousUserResource struct { ProviderData util.ProviderMetadata TypeName string }
func (*ArtifactoryAnonymousUserResource) Configure ¶
func (r *ArtifactoryAnonymousUserResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ArtifactoryAnonymousUserResource) Create ¶
func (r *ArtifactoryAnonymousUserResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ArtifactoryAnonymousUserResource) Delete ¶
func (r *ArtifactoryAnonymousUserResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ArtifactoryAnonymousUserResource) ImportState ¶
func (r *ArtifactoryAnonymousUserResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource into the Terraform state.
func (*ArtifactoryAnonymousUserResource) Metadata ¶
func (r *ArtifactoryAnonymousUserResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ArtifactoryAnonymousUserResource) Read ¶
func (r *ArtifactoryAnonymousUserResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ArtifactoryAnonymousUserResource) Schema ¶
func (r *ArtifactoryAnonymousUserResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ArtifactoryAnonymousUserResource) Update ¶
func (r *ArtifactoryAnonymousUserResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
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 (r *ArtifactoryBaseUserResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ArtifactoryBaseUserResource) Create ¶
func (r *ArtifactoryBaseUserResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ArtifactoryBaseUserResource) Delete ¶
func (r *ArtifactoryBaseUserResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ArtifactoryBaseUserResource) ImportState ¶
func (r *ArtifactoryBaseUserResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource into the Terraform state.
func (*ArtifactoryBaseUserResource) Metadata ¶
func (r *ArtifactoryBaseUserResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ArtifactoryBaseUserResource) Read ¶
func (r *ArtifactoryBaseUserResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ArtifactoryBaseUserResource) Update ¶
func (r *ArtifactoryBaseUserResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type ArtifactoryManagedUserResource ¶
type ArtifactoryManagedUserResource struct {
ArtifactoryBaseUserResource
}
func (*ArtifactoryManagedUserResource) Schema ¶
func (r *ArtifactoryManagedUserResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
type ArtifactoryUserAPIModel ¶ added in v10.4.3
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 ¶
func (r *ArtifactoryUserResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
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 ¶
func (u ArtifactoryUserResourceAPIModel) ToState(ctx context.Context, r *ArtifactoryUserResourceModel) diag.Diagnostics
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.