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 NewAnonymousUserResource() resource.Resource
- func NewManagedUserResource() resource.Resource
- func NewUserResource() resource.Resource
- func PackUser(user User, d *schema.ResourceData) diag.Diagnostics
- func ResourceArtifactoryUser() *schema.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 ArtifactoryUserResource
- type ArtifactoryUserResourceAPIModel
- type ArtifactoryUserResourceModel
- type GroupsAddRemove
- type User
Constants ¶
const UserEndpointPath = "access/api/v2/users/{name}"
const UserGroupEndpointPath = "access/api/v2/users/{name}/groups"
const UsersEndpointPath = "access/api/v2/users"
Variables ¶
This section is empty.
Functions ¶
func NewManagedUserResource ¶
func NewUserResource ¶
func PackUser ¶
func PackUser(user User, d *schema.ResourceData) diag.Diagnostics
func ResourceArtifactoryUser ¶
Types ¶
type ArtifactoryAnonymousUserResource ¶
type ArtifactoryAnonymousUserResource struct { ProviderData util.ProvderMetadata 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.ProvderMetadata 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 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"` 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.
type GroupsAddRemove ¶ added in v10.3.2
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"` }