Skip to content

Commit

Permalink
Refactor OIDC Support
Browse files Browse the repository at this point in the history
* Resolves #25 , #150, #149
  • Loading branch information
steve-r-west authored Mar 3, 2022
1 parent 2474492 commit 671d5b6
Show file tree
Hide file tree
Showing 54 changed files with 887 additions and 913 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ name: Release
on:
push:
tags:
- 'v0.0.1-alpha*'
- 'v0.0.*'
jobs:
goreleaser:
runs-on: ubuntu-latest
Expand All @@ -28,7 +28,7 @@ jobs:
name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.16
go-version: 1.17
-
name: Import GPG key
id: import_gpg
Expand Down
15 changes: 8 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
paths-ignore:
- 'README.md'
# For systems with an upstream API that could drift unexpectedly (like most SaaS systems, etc.),
# we recommend testing at a regular interval not necessarily tied to code changes. This will
# we recommend testing at a regular interval not necessarily tied to code changes. This will
# ensure you are alerted to something breaking due to an API change, even if the code did not
# change.
# schedule:
Expand All @@ -17,13 +17,13 @@ jobs:
build:
name: Build
runs-on: ubuntu-latest
timeout-minutes: 5
timeout-minutes: 15
steps:

- name: Set up Go
uses: actions/setup-go@v2.1.3
with:
go-version: '1.15'
go-version: '1.17'
id: go

- name: Check out code into the Go module directory
Expand All @@ -50,6 +50,7 @@ jobs:
run: |
go build -v .
# run acceptance tests in a matrix with Terraform core versions
test:
name: Matrix Test
Expand All @@ -63,13 +64,13 @@ jobs:
matrix:
# list whatever Terraform versions here you would like to support
terraform:
- '0.15.3'
- '1.1.5'
steps:

- name: Set up Go
uses: actions/setup-go@v2.1.3
with:
go-version: '1.15'
go-version: '1.17'
id: go

- name: Check out code into the Go module directory
Expand All @@ -78,9 +79,9 @@ jobs:
- name: Get dependencies
run: |
go mod download
- name: TF acceptance tests
timeout-minutes: 10
timeout-minutes: 15
env:
TF_ACC: "1"
TF_ACC_TERRAFORM_VERSION: ${{ matrix.terraform }}
Expand Down
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

*.dll
*.exe
.DS_Store
Expand Down Expand Up @@ -47,4 +48,4 @@ cmd/

*.tf

logs/
logs/
2 changes: 1 addition & 1 deletion docs/data-sources/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Represents the EPCC API [*PCM* Catalog Object](https://documentation.elasticpath

### Required

- **id** (String) The ID of this resource.
- **id** (String) The id of the catalog.

### Read-Only

Expand Down
2 changes: 1 addition & 1 deletion docs/data-sources/catalog_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Represents the EPCC API [*PCM* Catalog Rule Object](https://documentation.elasti

### Required

- **id** (String) The ID of this resource.
- **id** (String) The unique identifier of the catalog rule.

### Read-Only

Expand Down
12 changes: 6 additions & 6 deletions docs/data-sources/file.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ Represents the EPCC API [File Object](https://documentation.elasticpath.com/comm

### Required

- **id** (String) The ID of this resource.
- **id** (String) The unique identifier for the file.

### Optional

- **file_name** (String)
- **public** (Boolean)
- **file_name** (String) The name of the file
- **public** (Boolean) Whether the file is public.

### Read-Only

- **file_link** (String)
- **file_size** (Number)
- **mime_type** (String)
- **file_link** (String) A link to the file
- **file_size** (Number) The size of the file
- **mime_type** (String) The MIME type of the file

8 changes: 4 additions & 4 deletions docs/data-sources/hierarchy.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ Represents the EPCC API [Hierarchy Object](https://documentation.elasticpath.com

### Required

- **id** (String) The ID of this resource.
- **id** (String) The unique identifier of the hierarchy.

### Read-Only

- **description** (String)
- **name** (String)
- **slug** (String)
- **description** (String) A description of the hierarchy.
- **name** (String) The name of the hierarchy. The maximum length is 1000 characters.
- **slug** (String) A unique slug for the hierarchy.

12 changes: 6 additions & 6 deletions docs/data-sources/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@ Represents the EPCC API [Node Object](https://documentation.elasticpath.com/comm

### Required

- **hierarchy_id** (String)
- **id** (String) The ID of this resource.
- **hierarchy_id** (String) The unique identifier of the hierarchy.
- **id** (String) The unique identifier of the node.

### Optional

- **parent_id** (String)
- **parent_id** (String) The node ID for the parent node. The new node is created as a child of this parent node.

### Read-Only

- **description** (String)
- **name** (String)
- **slug** (String)
- **description** (String) A description of the node.
- **name** (String) A name for the node. Names must be unique among sibling nodes in the hierarchy, but otherwise a name can be non-unique. Cannot be null.
- **slug** (String) A slug for the node. Slugs must be unique among sibling nodes in the hierarchy, but otherwise a slug can be non-unique.

6 changes: 3 additions & 3 deletions docs/data-sources/node_product.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Represents the EPCC API [Node and Product Relationship](https://documentation.el

### Required

- **hierarchy_id** (String)
- **hierarchy_id** (String) The unique identifier of the hierarchy.
- **id** (String) The ID of this resource.
- **node_id** (String)
- **product_id** (String)
- **node_id** (String) The unique identifier of the node in the hierarchy.
- **product_id** (String) The unique identifier of the product.

6 changes: 3 additions & 3 deletions docs/data-sources/pricebook.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ Represents the EPCC API [PriceBook Object](https://documentation.elasticpath.com

### Required

- **id** (String) The ID of this resource.
- **id** (String) The unique identifier of the price book.

### Read-Only

- **description** (String)
- **name** (String)
- **description** (String) The purpose for the price book, such as flash sale pricing or preferred customer pricing.
- **name** (String) A unique name for the price book.

19 changes: 9 additions & 10 deletions docs/data-sources/promotion.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,18 @@ Represents the EPCC API [Promotion Object](https://documentation.elasticpath.com

### Optional

- **automatic** (Boolean)
- **max_discount_value** (Block List) (see [below for nested schema](#nestedblock--max_discount_value))
- **min_cart_value** (Block List) (see [below for nested schema](#nestedblock--min_cart_value))
- **automatic** (Boolean) Specifies whether the promotion is applied automatically to the cart or a code is required to apply the promotion. The default setting is `false`. When this value is set `true`, a code is autogenerated. If this value is set `false`, you must create the code manually
- **max_discount_value** (Block List) Provides the maximum possible discount for the cart (see [below for nested schema](#nestedblock--max_discount_value))
- **min_cart_value** (Block List) Provide the minimum cart value required for the promotion to apply. (see [below for nested schema](#nestedblock--min_cart_value))

### Read-Only

- **description** (String)
- **enabled** (Boolean)
- **end** (String)
- **name** (String)
- **promotion_type** (String)
- **start** (String)
- **type** (String)
- **description** (String) Specifies a description for the promotion.
- **enabled** (Boolean) Specifies whether the promotion is enabled. The options are `true` or `false`, and the default setting is `false`.
- **end** (String) Specifies the end date and time of the promotion or the end date of the promotion.
- **name** (String) Specifies a name for the promotion.
- **promotion_type** (String) Specifies the type of the promotion.
- **start** (String) Specifies the start date and time of the promotion or the start date of the promotion. You can provide a specific time in the HH:MM format. For example, `"start": "2000-01-01 12:00"`.

<a id="nestedblock--schema"></a>
### Nested Schema for `schema`
Expand Down
29 changes: 0 additions & 29 deletions docs/data-sources/realm.md

This file was deleted.

8 changes: 4 additions & 4 deletions docs/data-sources/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ Note: The `epcc_settings` resource behaves different from normal resources, in t

### Read-Only

- **additional_languages** (List of String)
- **calculation_method** (String)
- **list_child_products** (Boolean)
- **page_length** (Number)
- **additional_languages** (List of String) You can define additional language codes that are enabled for a project, this applies only to the legacy catalog and does not apply to PCM products, hierarchies, and catalogs.
- **calculation_method** (String) This option defines the method used to calculate cart and order totals.
- **list_child_products** (Boolean) Whether to display child products in product listings.
- **page_length** (Number) The number of results per page when paginating results

13 changes: 7 additions & 6 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,10 @@ $terraform plan

### Optional

- **additional_headers** (Map of String)
- **api_base_url** (String)
- **beta_features** (String)
- **client_id** (String)
- **client_secret** (String, Sensitive)
- **enable_authentication** (Boolean)
- **additional_headers** (Map of String) A set of additional HTTP Headers to send on all requests
- **api_base_url** (String) The **API base URL** for the store, this value is available in Commerce Manager under "Your API keys"
- **beta_features** (String) The value to use for the `EP-Beta_Features` header value which controls access to [Beta APIs](https://documentation.elasticpath.com/commerce-cloud/docs/api/basics/api-contract.html#beta-apis)
- **client_id** (String) The **Client ID** API key for the store, this value is available in Commerce Manager under "Your API keys"
- **client_secret** (String, Sensitive) The **Client Secret** API key for the store, this value is available in Commerce Manager under "Your API keys"
- **enable_authentication** (Boolean) Controls whether or not to authenticate before making a request. Disabling this may be appropriate if you are using additional_headers to supply an authentication token.
- **rate_limit** (Number) Controls the maximum number of requests this provider will make per second, which conforms to the [Rate Limits](https://documentation.elasticpath.com/commerce-cloud/docs/api/basics/rate-limits.html) of EPCC.
31 changes: 29 additions & 2 deletions docs/resources/authentication_realm.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,47 @@ description: |-

Represents the EPCC API [Authentication Realms](https://documentation.elasticpath.com/commerce-cloud/docs/api/single-sign-on/authentication-realms/index.html).

## Example Usage

```terraform
# Example usage to update the realm associated with Customer Authentication
data "epcc_customer_authentication_settings" "customer_auth_settings" {
}
resource "epcc_authentication_realm" "customer_realm" {
authentication_realm_id = data.epcc_customer_authentication_settings.customer_auth_settings.realm_id
duplicate_email_policy = "api_only"
redirect_uris = ["http://localhost:8000/"]
name = "Customer Authentication Realm"
}
# Example usage to update the realm associated with Account Authentication
data "epcc_account_authentication_settings" "account_auth_settings" {
}
resource "epcc_authentication_realm" "customer_realm" {
authentication_realm_id = data.epcc_account_authentication_settings.account_auth_settings.realm_id
duplicate_email_policy = "api_only"
redirect_uris = ["http://localhost:8888/"]
name = "Account Authentication Settings"
}
```

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

### Required

- **authentication_realm_id** (String) The unique identifier for the authentication realm.
- **duplicate_email_policy** (String) The values permitted for this parameter are, `allowed` or `api_only`. When an unfamiliar user signs in for the first time, a value of `allowed` always creates a new user with the name and e-mail address supplied by the identity provider. With the `api_only` value, the system assigns the user to an existing user with a matching e-mail address, if one already exists. The `api_only` setting is recommended only when all configured identity providers treat e-mail address as a unique identifier for the user, otherwise a user might get access to another user’s account and data. Thus the `api_only` value can simplify administration of users.
- **name** (String) The name of the authentication realm.
- **origin_id** (String) The ID of the origin entity.
- **origin_type** (String) The type of the origin entity.
- **redirect_uris** (List of String) An array of Storefront URIs that can start Single Sign On authentication. These URIs must follow the rules for [redirection endpoints in OAuth 2.0](https://tools.ietf.org/html/rfc6749#section-3.1.2). All URIs must start with `https://` except for `http://localhost`.

### Read-Only

- **id** (String) The unique identifier for the authentication realm.
- **origin_id** (String) The ID of the origin entity.
- **origin_type** (String) The type of the origin entity.

10 changes: 5 additions & 5 deletions docs/resources/catalog.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Represents the EPCC API [*PCM* Catalog Object](https://documentation.elasticpath

### Required

- **name** (String)
- **name** (String) The name of the catalog.

### Optional

- **description** (String)
- **hierarchies** (Set of String)
- **pricebook** (String)
- **description** (String) A description of the catalog, such as the purpose for the catalog.
- **hierarchies** (Set of String) The unique identifiers of the hierarchies to associate with this catalog.
- **pricebook** (String) The unique identifier of the price book to associate with this catalog.

### Read-Only

- **id** (String) The ID of this resource.
- **id** (String) The id of the catalog.

10 changes: 5 additions & 5 deletions docs/resources/catalog_rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ Represents the EPCC API [*PCM* Catalog Rule Object](https://documentation.elasti

### Required

- **catalog** (String)
- **name** (String)
- **catalog** (String) The unique identifier of the catalog for this rule. If you want to display a catalog that contains V2 Products, Brands, Categories, and Collections, specify `legacy`
- **name** (String) The name of the rule without spaces.

### Optional

- **customers** (Set of String)
- **description** (String)
- **customers** (Set of String) The list of customers who are eligible to see this catalog. If empty, the rule matches all customers.
- **description** (String) The purpose for this rule.

### Read-Only

- **id** (String) The ID of this resource.
- **id** (String) The unique identifier of the catalog rule.

Loading

0 comments on commit 671d5b6

Please sign in to comment.