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 SCIM user and group #120

Merged
merged 7 commits into from
Aug 12, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
## 1.11.0 (August 9, 2024). Tested on Artifactory 7.90.7 with Terraform 1.9.4 and OpenTofu 1.8.1
## 1.11.0 (August 12, 2024). Tested on Artifactory 7.90.7 with Terraform 1.9.4 and OpenTofu 1.8.1

FEATURES:

**New Resource:** `platform_saml_settings` - Resource to manage SAML SSO settings. PR: [#118](https://github.com/jfrog/terraform-provider-platform/pull/118)
**New Resource:**
* `platform_saml_settings` - Resource to manage SAML SSO settings. PR: [#118](https://github.com/jfrog/terraform-provider-platform/pull/118)
* `platform_scim_user` - Resource to manage SCIM user. PR: [#120](https://github.com/jfrog/terraform-provider-platform/pull/120)
* `platform_scim_group` - Resource to manage SCIM group. PR: [#120](https://github.com/jfrog/terraform-provider-platform/pull/120)

## 1.10.0 (July 21, 2024). Tested on Artifactory 7.84.17 with Terraform 1.9.2 and OpenTofu 1.7.3

Expand Down
2 changes: 1 addition & 1 deletion docs/resources/saml_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "platform_saml_settings" "my-okta-saml-settings" {

- `allow_user_to_access_profile` (Boolean) When set, 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_redirect` (Boolean) When set, clicking on the login link will direct users to the configured SAML login URL. Default value is `false`.
- `email_attribute` (String) If `no_auto_user_creation` is diabled or an internal user exists, the system will set the user's email to the value in this attribute that is returned by the SAML login XML response..
- `email_attribute` (String) If `no_auto_user_creation` is diabled or an internal user exists, the system will set the user's email to the value in this attribute that is returned by the SAML login XML response.
- `enable` (Boolean) When set, SAML integration is enabled and users may be authenticated via a SAML server. Default value is `true`.
- `group_attribute` (String) The group attribute in the SAML login XML response. Note that the system will search for a case-sensitive match to an existing group..
- `name_id_attribute` (String) The username attribute used to configure the SSO URL for the identity provider.
Expand Down
56 changes: 56 additions & 0 deletions docs/resources/scim_group.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "platform_scim_group Resource - terraform-provider-platform"
subcategory: ""
description: |-
Provides a JFrog SCIM Group https://jfrog.com/help/r/jfrog-platform-administration-documentation/scim resource to manage groups with the SCIM protocol.
---

# platform_scim_group (Resource)

Provides a JFrog [SCIM Group](https://jfrog.com/help/r/jfrog-platform-administration-documentation/scim) resource to manage groups with the SCIM protocol.

## Example Usage

```terraform
resource "platform_scim_group" "my-scim-group" {
id = "my-scim-group"
display_name = "my-scim-group"
members = [{
value = "[email protected]"
display = "[email protected]"
}, {
value = "anonymous"
display = "anonymous"
}]
}
```

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

### Required

- `display_name` (String)
- `id` (String) Group ID
- `members` (Attributes Set) (see [below for nested schema](#nestedatt--members))

### Read-Only

- `meta` (Map of String)

<a id="nestedatt--members"></a>
### Nested Schema for `members`

Required:

- `display` (String)
- `value` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import platform_scim_group.my-scim-group my-scim-group
```
65 changes: 65 additions & 0 deletions docs/resources/scim_user.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
# generated by https://github.com/hashicorp/terraform-plugin-docs
page_title: "platform_scim_user Resource - terraform-provider-platform"
subcategory: ""
description: |-
Provides a JFrog SCIM User https://jfrog.com/help/r/jfrog-platform-administration-documentation/scim resource to manage users with the SCIM protocol.
---

# platform_scim_user (Resource)

Provides a JFrog [SCIM User](https://jfrog.com/help/r/jfrog-platform-administration-documentation/scim) resource to manage users with the SCIM protocol.

## Example Usage

```terraform
resource "platform_scim_user" "my-scim-user" {
username = "[email protected]"
active = true
emails = [{
value = "[email protected]"
primary = true
}]
}
```

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

### Required

- `emails` (Attributes Set) (see [below for nested schema](#nestedatt--emails))
- `username` (String)

### Optional

- `active` (Boolean)

### Read-Only

- `groups` (Attributes Set) (see [below for nested schema](#nestedatt--groups))
- `meta` (Map of String)

<a id="nestedatt--emails"></a>
### Nested Schema for `emails`

Required:

- `primary` (Boolean)
- `value` (String)


<a id="nestedatt--groups"></a>
### Nested Schema for `groups`

Required:

- `value` (String)

## Import

Import is supported using the following syntax:

```shell
terraform import platform_scim_user.my-scim-user [email protected]
```
1 change: 1 addition & 0 deletions examples/resources/platform_scim_group/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import platform_scim_group.my-scim-group my-scim-group
11 changes: 11 additions & 0 deletions examples/resources/platform_scim_group/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
resource "platform_scim_group" "my-scim-group" {
id = "my-scim-group"
display_name = "my-scim-group"
members = [{
value = "[email protected]"
display = "[email protected]"
}, {
value = "anonymous"
display = "anonymous"
}]
}
1 change: 1 addition & 0 deletions examples/resources/platform_scim_user/import.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
terraform import platform_scim_user.my-scim-user [email protected]
8 changes: 8 additions & 0 deletions examples/resources/platform_scim_user/resource.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
resource "platform_scim_user" "my-scim-user" {
username = "[email protected]"
active = true
emails = [{
value = "[email protected]"
primary = true
}]
}
2 changes: 2 additions & 0 deletions pkg/platform/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ func (p *PlatformProvider) Resources(ctx context.Context) []func() resource.Reso
NewPermissionResource,
NewReverseProxyResource,
NewSAMLSettingsResource,
NewSCIMUserResource,
NewSCIMGroupResource,
NewWorkerServiceResource,
}
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/platform/resource_saml_settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ func (r *SAMLSettingsResource) Schema(ctx context.Context, req resource.SchemaRe
Validators: []validator.String{
stringvalidator.LengthAtLeast(1),
},
MarkdownDescription: "If `no_auto_user_creation` is diabled or an internal user exists, the system will set the user's email to the value in this attribute that is returned by the SAML login XML response..",
MarkdownDescription: "If `no_auto_user_creation` is diabled or an internal user exists, the system will set the user's email to the value in this attribute that is returned by the SAML login XML response.",
},
"group_attribute": schema.StringAttribute{
Optional: true,
Expand Down
Loading
Loading