Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add platform_crowd_settings resource #167

Merged
merged 6 commits into from
Dec 2, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# 1.19.0 (December 2, 2024)

FEATURES:

**New Resource:**

* `platform_crowd_settings` - Resource to manage Crowd/JIRA authentication provider. PR: [#167](https://github.com/jfrog/terraform-provider-platform/pull/167)

# 1.18.2 (November 27, 2024). Tested on Artifactory 7.98.9 with Terraform 1.9.8 and OpenTofu 1.8.6

BUG FIXES:
Expand All @@ -10,7 +18,7 @@ BUG FIXES:

* resource/platform_oidc_configuration: Update validation for `issuer` attribute to support GitHub actions customization for enterprise. See [Customizing the issuer value for an enterprise](https://docs.github.com/en/enterprise-cloud@latest/actions/security-for-github-actions/security-hardening-your-deployments/about-security-hardening-with-openid-connect#customizing-the-issuer-value-for-an-enterprise). PR: [#163](https://github.com/jfrog/terraform-provider-platform/pull/163) and [#164](https://github.com/jfrog/terraform-provider-platform/pull/164)

## 1.18.0 (November 21, 2024). Tested on Artifactory 7.98.9 with Terraform 1.9.8 and OpenTofu 1.8.6
## 1.18.0 (November 21, 2024). Tested on Artifactory 7.98.9 with Terraform 1.10.0 and OpenTofu 1.8.6

IMPROVEMENTS:

Expand Down
55 changes: 55 additions & 0 deletions docs/resources/crowd_settings.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "platform_crowd_settings Resource - terraform-provider-platform"
subcategory: ""
description: |-
Provides a JFrog Crowd Settings https://jfrog.com/help/r/jfrog-platform-administration-documentation/atlassian-crowd-and-jira-integration resource. This allows you to delegate authentication requests to Atlassian Crowd/JIRA, use authenticated Crowd/JIRA users and have the JPD participate in a transparent SSO environment managed by Crowd/JIRA.
---

# platform_crowd_settings (Resource)

Provides a JFrog [Crowd Settings](https://jfrog.com/help/r/jfrog-platform-administration-documentation/atlassian-crowd-and-jira-integration) resource. This allows you to delegate authentication requests to Atlassian Crowd/JIRA, use authenticated Crowd/JIRA users and have the JPD participate in a transparent SSO environment managed by Crowd/JIRA.

## Example Usage

```terraform
resource "platform_crowd_settings" "my-crowd-settings" {
enable = true
server_url = "http://tempurl.org"
application_name = "my-crowd-settings"
password = "my-password"
session_validation_interval = 5
use_default_proxy = false
auto_user_creation = true
allow_user_to_access_profile = false
direct_authentication = true
override_all_groups_upon_login = false
}
```

<!-- schema generated by tfplugindocs -->
## Schema

### Required

- `application_name` (String) The application name configured for JPD in Crowd/JIRA.
- `enable` (Boolean) Use this to enable security integration with Atlassian Crowd or JIRA.
- `password` (String, Sensitive) The application password configured for JPD in Crowd/JIRA.
- `server_url` (String) The full URL of the server to use.
- `session_validation_interval` (Number) The time window (min) during which the session does not need to be validated. If set to `0`, the token expires only when the session expires.

### Optional

- `allow_user_to_access_profile` (Boolean) Auto created users will have access to their profile page and will be able to perform actions such as generating an API key. Default value is `false`.
- `auto_user_creation` (Boolean) When set, authenticated users are automatically created in Artifactory. When not set, for every request from a Crowd user, the user is temporarily associated with default groups (if such groups are defined), and the permissions for these groups apply. Without automatic user creation, you must manually create the user in Artifactory to manage user permissions not attached to their default groups. Default value is `true`.
- `direct_authentication` (Boolean) This corresponds to 'Users Management Server' option in Artifactory UI (`true` = JIRA, `false` = Crowd). Default value is `false`.
- `override_all_groups_upon_login` (Boolean) When a user logs in with CROWD, only groups retrieved from CROWD will be associated with the user. Default value is `false`.
- `use_default_proxy` (Boolean) If a default proxy definition exists, it is used to pass through to the Crowd Server. Default value is `false`.

## Import

Import is supported using the following syntax:

```shell
terraform import platform_crowd_settings.my-crowd-settings my-crowd-settings
```
1 change: 1 addition & 0 deletions examples/resources/platform_crowd_settings/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import platform_crowd_settings.my-crowd-settings my-crowd-settings
12 changes: 12 additions & 0 deletions examples/resources/platform_crowd_settings/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "platform_crowd_settings" "my-crowd-settings" {
enable = true
server_url = "http://tempurl.org"
application_name = "my-crowd-settings"
password = "my-password"
session_validation_interval = 5
use_default_proxy = false
auto_user_creation = true
allow_user_to_access_profile = false
direct_authentication = true
override_all_groups_upon_login = false
}
1 change: 1 addition & 0 deletions pkg/platform/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ func (p *PlatformProvider) DataSources(ctx context.Context) []func() datasource.
func (p *PlatformProvider) Resources(ctx context.Context) []func() resource.Resource {
return []func() resource.Resource{
NewAWSIAMRoleResource,
NewCrowdSettingsResource,
NewLicenseResource,
NewGlobalRoleResource,
NewGroupResource,
Expand Down
Loading