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 User
Constants ¶
const UsersEndpointPath = "artifactory/api/security/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:"name"`
}
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 ¶ added in v9.9.2
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:"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"` }
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 User ¶
type User 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"` LastLoggedIn string `json:"lastLoggedIn"` Realm string `json:"realm"` Groups []string `json:"groups"` }