Skip to content

Commit

Permalink
Add deprecation notice for hooks and rules (#598)
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught authored May 23, 2023
1 parent 7f2eecc commit ca22016
Show file tree
Hide file tree
Showing 6 changed files with 74 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/resources/hook.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ description: |-

Hooks are secure, self-contained functions that allow you to customize the behavior of Auth0 when executed for selected extensibility points of the Auth0 platform. Auth0 invokes Hooks during runtime to execute your custom Node.js code. Depending on the extensibility point, you can use Hooks with Database Connections and/or Passwordless Connections.

!> This resource is deprecated. Refer to the [guide on how to migrate from rules to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions)
and manage your actions using the `auth0_action` resource.

## Example Usage

```terraform
Expand Down
3 changes: 3 additions & 0 deletions docs/resources/rule.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ description: |-

With Auth0, you can create custom Javascript snippets that run in a secure, isolated sandbox as part of your authentication pipeline, which are otherwise known as rules. This resource allows you to create and manage rules. You can create global variable for use with rules by using the `auth0_rule_config` resource.

!> This resource is deprecated. Refer to the [guide on how to migrate from hooks to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-hooks-to-actions)
and manage your actions using the `auth0_action` resource.

## Example Usage

```terraform
Expand Down
2 changes: 2 additions & 0 deletions internal/auth0/hook/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ import (
// NewResource will return a new auth0_hook resource.
func NewResource() *schema.Resource {
return &schema.Resource{
DeprecationMessage: "This resource is deprecated. Refer to the [guide on how to migrate from hooks to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-hooks-to-actions) " +
"and manage your actions using the `auth0_action` resource.",
CreateContext: createHook,
ReadContext: readHook,
UpdateContext: updateHook,
Expand Down
2 changes: 2 additions & 0 deletions internal/auth0/rule/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ var ruleNameRegexp = regexp.MustCompile(`^[^\s-][\w -]+[^\s-]$`)
// NewResource will return a new auth0_rule resource.
func NewResource() *schema.Resource {
return &schema.Resource{
DeprecationMessage: "This resource is deprecated. Refer to the [guide on how to migrate from rules to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions) " +
"and manage your actions using the `auth0_action` resource.",
CreateContext: createRule,
ReadContext: readRule,
UpdateContext: updateRule,
Expand Down
32 changes: 32 additions & 0 deletions templates/resources/hook.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
page_title: "{{.Type}}: {{.Name}}"
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Type}}: {{.Name}}

{{ .Description | trimspace }}

!> This resource is deprecated. Refer to the [guide on how to migrate from rules to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-rules-to-actions)
and manage your actions using the `auth0_action` resource.

{{ if .HasExample -}}

## Example Usage

{{ tffile .ExampleFile }}

{{- end }}

{{ .SchemaMarkdown | trimspace }}

{{ if .HasImport -}}

## Import

Import is supported using the following syntax:

{{ codefile "shell" .ImportFile }}

{{- end }}
32 changes: 32 additions & 0 deletions templates/resources/rule.md.tmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
page_title: "{{.Type}}: {{.Name}}"
description: |-
{{ .Description | plainmarkdown | trimspace | prefixlines " " }}
---

# {{.Type}}: {{.Name}}

{{ .Description | trimspace }}

!> This resource is deprecated. Refer to the [guide on how to migrate from hooks to actions](https://auth0.com/docs/customize/actions/migrate/migrate-from-hooks-to-actions)
and manage your actions using the `auth0_action` resource.

{{ if .HasExample -}}

## Example Usage

{{ tffile .ExampleFile }}

{{- end }}

{{ .SchemaMarkdown | trimspace }}

{{ if .HasImport -}}

## Import

Import is supported using the following syntax:

{{ codefile "shell" .ImportFile }}

{{- end }}

0 comments on commit ca22016

Please sign in to comment.