Documentation ¶
Index ¶
- Constants
- func CheckAccessToken(id string, request *resty.Request) (*resty.Response, error)
- func NewGlobalEnvironmentResource() resource.Resource
- func NewGroupResource() resource.Resource
- func NewPermissionTargetResource() resource.Resource
- func NewScopedTokenResource() resource.Resource
- func PermTargetExists(id string, m interface{}) (bool, error)
- func ResourceArtifactoryAccessToken() *schema.Resource
- func ResourceArtifactoryApiKey() *schema.Resource
- func ResourceArtifactoryCertificate() *schema.Resource
- func ResourceArtifactoryDistributionPublicKey() *schema.Resource
- func ResourceArtifactoryKeyPair() *schema.Resource
- func TokenOptsToValues(t AccessTokenOptions) (url.Values, error)
- func VerifyKeyPair(id string, request *resty.Request) (*resty.Response, error)
- type AccessTokenErrorResponseAPIModel
- type AccessTokenGetAPIModel
- type AccessTokenOptions
- type AccessTokenPostRequestAPIModel
- type AccessTokenPostResponseAPIModel
- type AccessTokenRevokeOptions
- type Actions
- type ApiKey
- type ArtifactoryGroupResource
- func (r *ArtifactoryGroupResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ArtifactoryGroupResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ArtifactoryGroupResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ArtifactoryGroupResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ArtifactoryGroupResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ArtifactoryGroupResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ArtifactoryGroupResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ArtifactoryGroupResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ArtifactoryGroupResourceAPIModel
- type ArtifactoryGroupResourceModel
- type CertificateDetails
- type DistributionPublicKeysList
- type GlobalEnvironmentModel
- type GlobalEnvironmentPostRenameRequestAPIModel
- type GlobalEnvironmentPostRequestAPIModel
- type GlobalEnvironmentResource
- func (r *GlobalEnvironmentResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *GlobalEnvironmentResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *GlobalEnvironmentResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *GlobalEnvironmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *GlobalEnvironmentResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *GlobalEnvironmentResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *GlobalEnvironmentResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *GlobalEnvironmentResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type GlobalEnvironmentsAPIModel
- type KeyPairPayLoad
- type PermissionTargetResource
- func (r *PermissionTargetResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *PermissionTargetResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *PermissionTargetResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *PermissionTargetResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *PermissionTargetResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *PermissionTargetResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *PermissionTargetResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *PermissionTargetResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type PermissionTargetResourceAPIModel
- type PermissionTargetResourceModel
- type PermissionTargetSection
- type ScopedTokenResource
- func (r *ScopedTokenResource) Configure(ctx context.Context, req resource.ConfigureRequest, ...)
- func (r *ScopedTokenResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
- func (r *ScopedTokenResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
- func (r *ScopedTokenResource) ImportState(ctx context.Context, req resource.ImportStateRequest, ...)
- func (r *ScopedTokenResource) Metadata(ctx context.Context, req resource.MetadataRequest, ...)
- func (r *ScopedTokenResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
- func (r *ScopedTokenResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
- func (r *ScopedTokenResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
- type ScopedTokenResourceModel
Constants ¶
const ( PermRead = "read" PermWrite = "write" PermAnnotate = "annotate" PermDelete = "delete" PermManage = "manage" PermManagedXrayMeta = "managedXrayMeta" PermDistribute = "distribute" )
const ApiKeyEndpoint = "artifactory/api/security/apiKey"
const CertificateEndpoint = "artifactory/api/system/security/certificates/"
const DistributionPublicKeysAPIEndPoint = "artifactory/api/security/keys/trusted"
const GroupsEndpoint = "artifactory/api/security/groups/"
const KeypairEndPoint = "artifactory/api/security/keypair/"
const PermissionsEndPoint = "artifactory/api/v2/security/permissions/"
Variables ¶
This section is empty.
Functions ¶
func CheckAccessToken ¶
func NewGlobalEnvironmentResource ¶ added in v8.8.1
func NewGroupResource ¶
func NewScopedTokenResource ¶
func PermTargetExists ¶
func TokenOptsToValues ¶
func TokenOptsToValues(t AccessTokenOptions) (url.Values, error)
func VerifyKeyPair ¶
Types ¶
type AccessTokenGetAPIModel ¶
type AccessTokenOptions ¶
type AccessTokenOptions struct { // The grant type used to authenticate the request. In this case, the only value supported is "client_credentials" which is also the default value if this parameter is not specified. GrantType string `url:"grant_type,omitempty"` // [Optional, default: "client_credentials"] // The user name for which this token is created. If the user does not exist, a transient user is created. Non-admin users can only create tokens for themselves so they must specify their own username. // If the user does not exist, the member-of-groups scope token must be provided (e.g. member-of-groups: g1, g2, g3...) Username string `url:"username,omitempty"` // The scope to assign to the token provided as a space-separated list of scope tokens. Currently there are three possible scope tokens: // - "api:*" - indicates that the token grants access to REST API calls. This is always granted by default whether specified in the call or not. // - member-of-groups:[<group-name>] - indicates the groups that the token is associated with (e.g. member-of-groups: g1, g2, g3...). The token grants access according to the permission targets specified for the groups listed. // Specify "*" for group-name to indicate that the token should provide the same access privileges that are given to the group of which the logged in user is a member. // A non-admin user can only provide a scope that is a subset of the groups to which he belongs // - "jfrt@<instance-id>:admin" - provides admin privileges on the specified Artifactory instance. This is only available for administrators. // If omitted and the username specified exists, the token is granted the scope of that user. Scope string `url:"scope,omitempty"` // [Optional if the user specified in username exists] // The time in seconds for which the token will be valid. To specify a token that never expires, set to zero. Non-admin can only set a value that is equal to or less than the default 3600. ExpiresIn int `url:"expires_in"` // [Optional, default: 3600] // If true, this token is refreshable and the refresh token can be used to replace it with a new token once it expires. Refreshable string `url:"refreshable,omitempty"` // [Optional, default: false] // A space-separate list of the other Artifactory instances or services that should accept this token identified by their Artifactory Service IDs as obtained from the Get Service ID endpoint. // In case you want the token to be accepted by all Artifactory instances you may use the following audience parameter "audience=jfrt@*". Audience string `url:"audience,omitempty"` // [Optional, default: Only the Service ID of the Artifactory instance that created the token] }
type AccessTokenPostRequestAPIModel ¶
type AccessTokenPostRequestAPIModel struct { GrantType string `json:"grant_type"` Username string `json:"username,omitempty"` ProjectKey string `json:"project_key"` Scope string `json:"scope,omitempty"` ExpiresIn int64 `json:"expires_in"` Refreshable bool `json:"refreshable"` Description string `json:"description,omitempty"` Audience string `json:"audience,omitempty"` IncludeReferenceToken bool `json:"include_reference_token"` }
type AccessTokenPostResponseAPIModel ¶
type AccessTokenPostResponseAPIModel struct { TokenId string `json:"token_id"` AccessToken string `json:"access_token"` RefreshToken string `json:"refresh_token"` ExpiresIn int64 `json:"expires_in"` Scope string `json:"scope"` TokenType string `json:"token_type"` ReferenceToken string `json:"reference_token"` }
type AccessTokenRevokeOptions ¶
type AccessTokenRevokeOptions struct {
Token string `url:"token,omitempty"`
}
AccessTokenRevokeOptions jfrog client go has no v1 code and moving to v2 would be a lot of work. To remove the dependency, we copy and past it here
type ArtifactoryGroupResource ¶
type ArtifactoryGroupResource struct {
ProviderData utilsdk.ProvderMetadata
}
func (*ArtifactoryGroupResource) Configure ¶
func (r *ArtifactoryGroupResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ArtifactoryGroupResource) Create ¶
func (r *ArtifactoryGroupResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ArtifactoryGroupResource) Delete ¶
func (r *ArtifactoryGroupResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ArtifactoryGroupResource) ImportState ¶
func (r *ArtifactoryGroupResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource into the Terraform state.
func (*ArtifactoryGroupResource) Metadata ¶
func (r *ArtifactoryGroupResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ArtifactoryGroupResource) Read ¶
func (r *ArtifactoryGroupResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ArtifactoryGroupResource) Schema ¶
func (r *ArtifactoryGroupResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ArtifactoryGroupResource) Update ¶
func (r *ArtifactoryGroupResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type ArtifactoryGroupResourceAPIModel ¶
type ArtifactoryGroupResourceAPIModel struct { Name string `json:"name"` Description string `json:"description,omitempty"` ExternalId string `json:"externalId,omitempty"` AutoJoin bool `json:"autoJoin"` AdminPrivileges bool `json:"adminPrivileges"` Realm string `json:"realm"` RealmAttributes string `json:"realmAttributes,omitempty"` UsersNames []string `json:"userNames"` WatchManager bool `json:"watchManager"` PolicyManager bool `json:"policyManager"` ReportsManager bool `json:"reportsManager"` }
ArtifactoryGroupResourceAPIModel describes the API data model.
type ArtifactoryGroupResourceModel ¶
type ArtifactoryGroupResourceModel struct { Id types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` Description types.String `tfsdk:"description"` ExternalId types.String `tfsdk:"external_id"` AutoJoin types.Bool `tfsdk:"auto_join"` AdminPrivileges types.Bool `tfsdk:"admin_privileges"` Realm types.String `tfsdk:"realm"` RealmAttributes types.String `tfsdk:"realm_attributes"` DetachAllUsers types.Bool `tfsdk:"detach_all_users"` UsersNames types.Set `tfsdk:"users_names"` WatchManager types.Bool `tfsdk:"watch_manager"` PolicyManager types.Bool `tfsdk:"policy_manager"` ReportsManager types.Bool `tfsdk:"reports_manager"` }
ArtifactoryGroupResourceModel describes the Terraform resource data model to match the resource schema.
func (*ArtifactoryGroupResourceModel) ToState ¶
func (r *ArtifactoryGroupResourceModel) ToState(ctx context.Context, group ArtifactoryGroupResourceAPIModel) diag.Diagnostics
type CertificateDetails ¶
type CertificateDetails struct { CertificateAlias string `json:"certificateAlias,omitempty"` IssuedTo string `json:"issuedTo,omitempty"` IssuedBy string `json:"issuedby,omitempty"` IssuedOn string `json:"issuedOn,omitempty"` ValidUntil string `json:"validUntil,omitempty"` FingerPrint string `json:"fingerPrint,omitempty"` }
CertificateDetails this type doesn't even exist in the new go client. In fact, the whole API call doesn't
func FindCertificate ¶
func FindCertificate(alias string, m interface{}) (*CertificateDetails, error)
type DistributionPublicKeysList ¶
type DistributionPublicKeysList struct {
Keys []distributionPublicKeyPayLoad `json:"keys"`
}
type GlobalEnvironmentModel ¶ added in v8.8.1
type GlobalEnvironmentModel struct { Id types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` }
GlobalEnvironmentModel describes the Terraform resource data model to match the resource schema.
type GlobalEnvironmentPostRenameRequestAPIModel ¶ added in v8.8.1
type GlobalEnvironmentPostRenameRequestAPIModel struct {
Name string `json:"new_name"`
}
type GlobalEnvironmentPostRequestAPIModel ¶ added in v8.8.1
type GlobalEnvironmentPostRequestAPIModel struct {
Name string `json:"name"`
}
type GlobalEnvironmentResource ¶ added in v8.8.1
type GlobalEnvironmentResource struct {
ProviderData utilsdk.ProvderMetadata
}
func (*GlobalEnvironmentResource) Configure ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*GlobalEnvironmentResource) Create ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*GlobalEnvironmentResource) Delete ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*GlobalEnvironmentResource) ImportState ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource into the Terraform state.
func (*GlobalEnvironmentResource) Metadata ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*GlobalEnvironmentResource) Read ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*GlobalEnvironmentResource) Schema ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*GlobalEnvironmentResource) Update ¶ added in v8.8.1
func (r *GlobalEnvironmentResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type GlobalEnvironmentsAPIModel ¶ added in v8.8.1
type GlobalEnvironmentsAPIModel []struct { Name string `json:"name"` }
type KeyPairPayLoad ¶
type KeyPairPayLoad struct { PairName string `hcl:"pair_name" json:"pairName"` PairType string `hcl:"pair_type" json:"pairType"` Alias string `hcl:"alias" json:"alias"` PrivateKey string `hcl:"private_key" json:"privateKey"` Passphrase string `hcl:"passphrase" json:"passphrase"` PublicKey string `hcl:"public_key" json:"publicKey"` }
func (KeyPairPayLoad) Id ¶
func (kp KeyPairPayLoad) Id() string
type PermissionTargetResource ¶
type PermissionTargetResource struct {
ProviderData utilsdk.ProvderMetadata
}
func (*PermissionTargetResource) Configure ¶
func (r *PermissionTargetResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*PermissionTargetResource) Create ¶
func (r *PermissionTargetResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*PermissionTargetResource) Delete ¶
func (r *PermissionTargetResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*PermissionTargetResource) ImportState ¶
func (r *PermissionTargetResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource into the Terraform state.
func (*PermissionTargetResource) Metadata ¶
func (r *PermissionTargetResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*PermissionTargetResource) Read ¶
func (r *PermissionTargetResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*PermissionTargetResource) Schema ¶
func (r *PermissionTargetResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*PermissionTargetResource) Update ¶
func (r *PermissionTargetResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type PermissionTargetResourceAPIModel ¶
type PermissionTargetResourceAPIModel struct { Name string `json:"name"` Repo *PermissionTargetSection `json:"repo,omitempty"` Build *PermissionTargetSection `json:"build,omitempty"` ReleaseBundle *PermissionTargetSection `json:"releaseBundle,omitempty"` }
PermissionTargetResourceAPIModel describes the API data model. Copy from https://github.com/jfrog/jfrog-client-go/blob/master/artifactory/services/permissiontarget.go#L116
Using struct pointers to keep the fields null if they are empty. Artifactory evaluates inner struct typed fields if they are not null, which can lead to failures in the request.
type PermissionTargetResourceModel ¶
type PermissionTargetResourceModel struct { Id types.String `tfsdk:"id"` Name types.String `tfsdk:"name"` Repo types.Set `tfsdk:"repo"` Build types.Set `tfsdk:"build"` ReleaseBundle types.Set `tfsdk:"release_bundle"` }
PermissionTargetResourceModel describes the Terraform resource data model to match the resource schema.
func (*PermissionTargetResourceModel) ToState ¶
func (r *PermissionTargetResourceModel) ToState(ctx context.Context, diags diag.Diagnostics, permissionTarget *PermissionTargetResourceAPIModel)
type PermissionTargetSection ¶
type ScopedTokenResource ¶
type ScopedTokenResource struct {
ProviderData utilsdk.ProvderMetadata
}
func (*ScopedTokenResource) Configure ¶
func (r *ScopedTokenResource) Configure(ctx context.Context, req resource.ConfigureRequest, resp *resource.ConfigureResponse)
func (*ScopedTokenResource) Create ¶
func (r *ScopedTokenResource) Create(ctx context.Context, req resource.CreateRequest, resp *resource.CreateResponse)
func (*ScopedTokenResource) Delete ¶
func (r *ScopedTokenResource) Delete(ctx context.Context, req resource.DeleteRequest, resp *resource.DeleteResponse)
func (*ScopedTokenResource) ImportState ¶
func (r *ScopedTokenResource) ImportState(ctx context.Context, req resource.ImportStateRequest, resp *resource.ImportStateResponse)
ImportState imports the resource into the Terraform state.
func (*ScopedTokenResource) Metadata ¶
func (r *ScopedTokenResource) Metadata(ctx context.Context, req resource.MetadataRequest, resp *resource.MetadataResponse)
func (*ScopedTokenResource) Read ¶
func (r *ScopedTokenResource) Read(ctx context.Context, req resource.ReadRequest, resp *resource.ReadResponse)
func (*ScopedTokenResource) Schema ¶
func (r *ScopedTokenResource) Schema(ctx context.Context, req resource.SchemaRequest, resp *resource.SchemaResponse)
func (*ScopedTokenResource) Update ¶
func (r *ScopedTokenResource) Update(ctx context.Context, req resource.UpdateRequest, resp *resource.UpdateResponse)
type ScopedTokenResourceModel ¶
type ScopedTokenResourceModel struct { Id types.String `tfsdk:"id"` GrantType types.String `tfsdk:"grant_type"` Username types.String `tfsdk:"username"` ProjectKey types.String `tfsdk:"project_key"` Scopes types.Set `tfsdk:"scopes"` ExpiresIn types.Int64 `tfsdk:"expires_in"` Refreshable types.Bool `tfsdk:"refreshable"` IncludeReferenceToken types.Bool `tfsdk:"include_reference_token"` Description types.String `tfsdk:"description"` Audiences types.Set `tfsdk:"audiences"` AccessToken types.String `tfsdk:"access_token"` RefreshToken types.String `tfsdk:"refresh_token"` ReferenceToken types.String `tfsdk:"reference_token"` TokenType types.String `tfsdk:"token_type"` Subject types.String `tfsdk:"subject"` Expiry types.Int64 `tfsdk:"expiry"` IssuedAt types.Int64 `tfsdk:"issued_at"` Issuer types.String `tfsdk:"issuer"` }
ScopedTokenResourceModel describes the Terraform resource data model to match the resource schema.
func (*ScopedTokenResourceModel) GetResponseToState ¶
func (r *ScopedTokenResourceModel) GetResponseToState(ctx context.Context, accessToken *AccessTokenGetAPIModel)
func (*ScopedTokenResourceModel) PostResponseToState ¶
func (r *ScopedTokenResourceModel) PostResponseToState(ctx context.Context, accessTokenResp *AccessTokenPostResponseAPIModel, accessTokenPostBody *AccessTokenPostRequestAPIModel, getResult *AccessTokenGetAPIModel) diag.Diagnostics
Source Files ¶
- resource_artifactory_access_token.go
- resource_artifactory_api_key.go
- resource_artifactory_certificate.go
- resource_artifactory_distribution_public_key.go
- resource_artifactory_global_environment.go
- resource_artifactory_group.go
- resource_artifactory_keypair.go
- resource_artifactory_permission_target.go
- resource_artifactory_scoped_token.go
- security.go