Skip to content

Commit 2d23727

Browse files
authored
Merge branch 'main' into DXCDT-1165-support-acul-command
2 parents 8a69cff + 05ac10f commit 2d23727

File tree

13 files changed

+202
-41
lines changed

13 files changed

+202
-41
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,21 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
# [v.1.22.0](https://github.com/auth0/auth0-cli/tree/v1.22.0) (October 21, 2025)
11+
12+
[Full Changelog](https://github.com/auth0/auth0-cli/compare/v1.21.0...v1.22.0)
13+
14+
### Added
15+
- Add support for `auth0_branding_theme` in `auth0 tf generate` [#1366]
16+
- Add support for token vault in `auth0 apps create` and `auth0 apps show <client-id>` [#1352]
17+
- Add support for interactive support for comparing action versions in `auth0 actions diff <action-id>` [#1351]
18+
19+
### Fixed
20+
- Fix missing email templates in terraform fetcher [#1362]
21+
- Fix prevent and recover from JWT token corruption in keyring storage [#1358]
22+
- Fix `auth apis create` subject type authorization validation [#1361]
23+
24+
1025
# [v.1.21.0](https://github.com/auth0/auth0-cli/tree/v1.21.0) (September 30, 2025)
1126

1227
[Full Changelog](https://github.com/auth0/auth0-cli/compare/v1.20.1...v1.21.0)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
[![Codecov](https://img.shields.io/codecov/c/github/auth0/auth0-cli?logo=codecov&style=flat-square)](https://codecov.io/gh/auth0/auth0-cli)
88
[![License](https://img.shields.io/github/license/auth0/auth0-cli.svg?logo=fossa&style=flat-square)](https://github.com/auth0/auth0-cli/blob/main/LICENSE)
99
[![Build Status](https://img.shields.io/github/actions/workflow/status/auth0/auth0-cli/go.yml?branch=main&style=flat-square&logo=github)](https://github.com/auth0/auth0-cli/actions?query=branch%3Amain)
10+
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/auth0/auth0-cli)
1011

1112
</div>
1213

@@ -235,4 +236,3 @@ Please do not report security vulnerabilities on the public GitHub issue tracker
235236
<p align="center">Auth0 is an easy to implement, adaptable authentication and authorization platform. To learn more checkout <a href="https://auth0.com/why-auth0">Why Auth0?</a></p>
236237
<p align="center">
237238
This project is licensed under the MIT license. See the <a href="https://github.com/auth0/auth0-cli/blob/main/LICENSE"> LICENSE</a> file for more info.</p>
238-

docs/auth0_terraform_generate.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ auth0 terraform generate [flags]
3333
```
3434
--force Skip confirmation.
3535
-o, --output-dir string Output directory for the generated Terraform config files. If not provided, the files will be saved in the current working directory. (default "./")
36-
-r, --resources strings Resource types to generate Terraform config for. If not provided, config files for all available resources will be generated. (default [auth0_action,auth0_attack_protection,auth0_branding,auth0_phone_provider,auth0_client,auth0_client_grant,auth0_connection,auth0_custom_domain,auth0_flow,auth0_flow_vault_connection,auth0_form,auth0_email_provider,auth0_email_template,auth0_guardian,auth0_log_stream,auth0_network_acl,auth0_organization,auth0_pages,auth0_prompt,auth0_prompt_custom_text,auth0_prompt_screen_renderer,auth0_resource_server,auth0_role,auth0_self_service_profile,auth0_tenant,auth0_trigger_actions,auth0_user_attribute_profile])
36+
-r, --resources strings Resource types to generate Terraform config for. If not provided, config files for all available resources will be generated. (default [auth0_action,auth0_attack_protection,auth0_branding,auth0_branding_theme,auth0_phone_provider,auth0_client,auth0_client_grant,auth0_connection,auth0_custom_domain,auth0_flow,auth0_flow_vault_connection,auth0_form,auth0_email_provider,auth0_email_template,auth0_guardian,auth0_log_stream,auth0_network_acl,auth0_organization,auth0_pages,auth0_prompt,auth0_prompt_custom_text,auth0_prompt_screen_renderer,auth0_resource_server,auth0_role,auth0_self_service_profile,auth0_tenant,auth0_trigger_actions,auth0_user_attribute_profile])
3737
-v, --tf-version string Terraform version that ought to be used while generating the terraform files for resources. If not provided, 1.5.0 is used by default (default "1.5.0")
3838
```
3939

go.mod

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@ require (
1111
github.com/charmbracelet/glamour v0.10.0
1212
github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e
1313
github.com/fsnotify/fsnotify v1.9.0
14-
github.com/getsentry/sentry-go v0.35.3
14+
github.com/getsentry/sentry-go v0.36.0
1515
github.com/golang/mock v1.6.0
1616
github.com/google/go-cmp v0.7.0
1717
github.com/google/uuid v1.6.0
1818
github.com/gorilla/websocket v1.5.3
1919
github.com/hashicorp/go-version v1.7.0
2020
github.com/hashicorp/hc-install v0.9.2
21-
github.com/hashicorp/terraform-exec v0.23.0
21+
github.com/hashicorp/terraform-exec v0.24.0
2222
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
2323
github.com/lestrrat-go/jwx/v2 v2.1.6
24-
github.com/lestrrat-go/jwx/v3 v3.0.10
24+
github.com/lestrrat-go/jwx/v3 v3.0.12
2525
github.com/logrusorgru/aurora v2.0.3+incompatible
2626
github.com/manifoldco/promptui v0.9.0
2727
github.com/mattn/go-isatty v0.0.20
@@ -69,13 +69,15 @@ require (
6969
github.com/gorilla/css v1.0.1 // indirect
7070
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
7171
github.com/hashicorp/go-retryablehttp v0.7.7 // indirect
72-
github.com/hashicorp/terraform-json v0.24.0 // indirect
72+
github.com/hashicorp/terraform-json v0.27.1 // indirect
7373
github.com/inconshreveable/mousetrap v1.1.0 // indirect
7474
github.com/kr/text v0.2.0 // indirect
7575
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
76+
github.com/lestrrat-go/dsig v1.0.0 // indirect
77+
github.com/lestrrat-go/dsig-secp256k1 v1.0.0 // indirect
7678
github.com/lestrrat-go/httpcc v1.0.1 // indirect
7779
github.com/lestrrat-go/httprc v1.0.6 // indirect
78-
github.com/lestrrat-go/httprc/v3 v3.0.0 // indirect
80+
github.com/lestrrat-go/httprc/v3 v3.0.1 // indirect
7981
github.com/lestrrat-go/iter v1.0.2 // indirect
8082
github.com/lestrrat-go/option v1.0.1 // indirect
8183
github.com/lestrrat-go/option/v2 v2.0.0 // indirect
@@ -88,12 +90,12 @@ require (
8890
github.com/muesli/reflow v0.3.0 // indirect
8991
github.com/muesli/termenv v0.16.0 // indirect
9092
github.com/rivo/uniseg v0.4.7 // indirect
91-
github.com/segmentio/asm v1.2.0 // indirect
93+
github.com/segmentio/asm v1.2.1 // indirect
9294
github.com/valyala/fastjson v1.6.4 // indirect
9395
github.com/xo/terminfo v0.0.0-20220910002029-abceb7e1c41e // indirect
9496
github.com/yuin/goldmark v1.7.8 // indirect
9597
github.com/yuin/goldmark-emoji v1.0.5 // indirect
96-
github.com/zclconf/go-cty v1.16.2 // indirect
98+
github.com/zclconf/go-cty v1.16.4 // indirect
9799
golang.org/x/crypto v0.43.0 // indirect
98100
golang.org/x/exp v0.0.0-20230321023759-10a507213a29 // indirect
99101
golang.org/x/mod v0.28.0 // indirect

go.sum

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ github.com/fatih/color v1.16.0 h1:zmkK9Ngbjj+K0yRhTVONQh1p/HknKYSlNT+vZCzyokM=
8484
github.com/fatih/color v1.16.0/go.mod h1:fL2Sau1YI5c0pdGEVCbKQbLXB6edEj1ZgiY4NijnWvE=
8585
github.com/fsnotify/fsnotify v1.9.0 h1:2Ml+OJNzbYCTzsxtv8vKSFD9PbJjmhYF14k/jKC7S9k=
8686
github.com/fsnotify/fsnotify v1.9.0/go.mod h1:8jBTzvmWwFyi3Pb8djgCCO5IBqzKJ/Jwo8TRcHyHii0=
87-
github.com/getsentry/sentry-go v0.35.3 h1:u5IJaEqZyPdWqe/hKlBKBBnMTSxB/HenCqF3QLabeds=
88-
github.com/getsentry/sentry-go v0.35.3/go.mod h1:mdL49ixwT2yi57k5eh7mpnDyPybixPzlzEJFu0Z76QA=
87+
github.com/getsentry/sentry-go v0.36.0 h1:UkCk0zV28PiGf+2YIONSSYiYhxwlERE5Li3JPpZqEns=
88+
github.com/getsentry/sentry-go v0.36.0/go.mod h1:p5Im24mJBeruET8Q4bbcMfCQ+F+Iadc4L48tB1apo2c=
8989
github.com/go-errors/errors v1.4.2 h1:J6MZopCL4uSllY1OfXM374weqZFFItUbrImctkmUxIA=
9090
github.com/go-errors/errors v1.4.2/go.mod h1:sIVyrIiJhuEF+Pj9Ebtd6P/rEYROXFi3BopGUQ5a5Og=
9191
github.com/go-git/gcfg v1.5.1-0.20230307220236-3a3c6141e376 h1:+zs/tPmkDkHx3U66DAb0lQFJrpS6731Oaa12ikc+DiI=
@@ -122,10 +122,10 @@ github.com/hashicorp/go-version v1.7.0 h1:5tqGy27NaOTB8yJKUZELlFAS/LTKJkrmONwQKe
122122
github.com/hashicorp/go-version v1.7.0/go.mod h1:fltr4n8CU8Ke44wwGCBoEymUuxUHl09ZGVZPK5anwXA=
123123
github.com/hashicorp/hc-install v0.9.2 h1:v80EtNX4fCVHqzL9Lg/2xkp62bbvQMnvPQ0G+OmtO24=
124124
github.com/hashicorp/hc-install v0.9.2/go.mod h1:XUqBQNnuT4RsxoxiM9ZaUk0NX8hi2h+Lb6/c0OZnC/I=
125-
github.com/hashicorp/terraform-exec v0.23.0 h1:MUiBM1s0CNlRFsCLJuM5wXZrzA3MnPYEsiXmzATMW/I=
126-
github.com/hashicorp/terraform-exec v0.23.0/go.mod h1:mA+qnx1R8eePycfwKkCRk3Wy65mwInvlpAeOwmA7vlY=
127-
github.com/hashicorp/terraform-json v0.24.0 h1:rUiyF+x1kYawXeRth6fKFm/MdfBS6+lW4NbeATsYz8Q=
128-
github.com/hashicorp/terraform-json v0.24.0/go.mod h1:Nfj5ubo9xbu9uiAoZVBsNOjvNKB66Oyrvtit74kC7ow=
125+
github.com/hashicorp/terraform-exec v0.24.0 h1:mL0xlk9H5g2bn0pPF6JQZk5YlByqSqrO5VoaNtAf8OE=
126+
github.com/hashicorp/terraform-exec v0.24.0/go.mod h1:lluc/rDYfAhYdslLJQg3J0oDqo88oGQAdHR+wDqFvo4=
127+
github.com/hashicorp/terraform-json v0.27.1 h1:zWhEracxJW6lcjt/JvximOYyc12pS/gaKSy/wzzE7nY=
128+
github.com/hashicorp/terraform-json v0.27.1/go.mod h1:GzPLJ1PLdUG5xL6xn1OXWIjteQRT2CNT9o/6A9mi9hE=
129129
github.com/hexops/gotextdiff v1.0.3 h1:gitA9+qJrrTCsiCl7+kh75nPqQt1cx4ZkudSTLoUqJM=
130130
github.com/hexops/gotextdiff v1.0.3/go.mod h1:pSWU5MAI3yDq+fZBTazCSJysOMbxWL1BSow5/V2vxeg=
131131
github.com/hinshun/vt10x v0.0.0-20220119200601-820417d04eec h1:qv2VnGeEQHchGaZ/u7lxST/RaJw+cv273q79D81Xbog=
@@ -146,18 +146,22 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
146146
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
147147
github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA=
148148
github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw=
149+
github.com/lestrrat-go/dsig v1.0.0 h1:OE09s2r9Z81kxzJYRn07TFM9XA4akrUdoMwr0L8xj38=
150+
github.com/lestrrat-go/dsig v1.0.0/go.mod h1:dEgoOYYEJvW6XGbLasr8TFcAxoWrKlbQvmJgCR0qkDo=
151+
github.com/lestrrat-go/dsig-secp256k1 v1.0.0 h1:JpDe4Aybfl0soBvoVwjqDbp+9S1Y2OM7gcrVVMFPOzY=
152+
github.com/lestrrat-go/dsig-secp256k1 v1.0.0/go.mod h1:CxUgAhssb8FToqbL8NjSPoGQlnO4w3LG1P0qPWQm/NU=
149153
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
150154
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
151155
github.com/lestrrat-go/httprc v1.0.6 h1:qgmgIRhpvBqexMJjA/PmwSvhNk679oqD1RbovdCGW8k=
152156
github.com/lestrrat-go/httprc v1.0.6/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
153-
github.com/lestrrat-go/httprc/v3 v3.0.0 h1:nZUx/zFg5uc2rhlu1L1DidGr5Sj02JbXvGSpnY4LMrc=
154-
github.com/lestrrat-go/httprc/v3 v3.0.0/go.mod h1:k2U1QIiyVqAKtkffbg+cUmsyiPGQsb9aAfNQiNFuQ9Q=
157+
github.com/lestrrat-go/httprc/v3 v3.0.1 h1:3n7Es68YYGZb2Jf+k//llA4FTZMl3yCwIjFIk4ubevI=
158+
github.com/lestrrat-go/httprc/v3 v3.0.1/go.mod h1:2uAvmbXE4Xq8kAUjVrZOq1tZVYYYs5iP62Cmtru00xk=
155159
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
156160
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
157161
github.com/lestrrat-go/jwx/v2 v2.1.6 h1:hxM1gfDILk/l5ylers6BX/Eq1m/pnxe9NBwW6lVfecA=
158162
github.com/lestrrat-go/jwx/v2 v2.1.6/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU=
159-
github.com/lestrrat-go/jwx/v3 v3.0.10 h1:XuoCBhZBncRIjMQ32HdEc76rH0xK/Qv2wq5TBouYJDw=
160-
github.com/lestrrat-go/jwx/v3 v3.0.10/go.mod h1:kNMedLgTpHvPJkK5EMVa1JFz+UVyY2dMmZKu3qjl/Pk=
163+
github.com/lestrrat-go/jwx/v3 v3.0.12 h1:p25r68Y4KrbBdYjIsQweYxq794CtGCzcrc5dGzJIRjg=
164+
github.com/lestrrat-go/jwx/v3 v3.0.12/go.mod h1:HiUSaNmMLXgZ08OmGBaPVvoZQgJVOQphSrGr5zMamS8=
161165
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
162166
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
163167
github.com/lestrrat-go/option/v2 v2.0.0 h1:XxrcaJESE1fokHy3FpaQ/cXW8ZsIdWcdFzzLOcID3Ss=
@@ -213,8 +217,8 @@ github.com/rogpeppe/go-internal v1.8.0/go.mod h1:WmiCO8CzOY8rg0OYDC4/i/2WRWAB6po
213217
github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM=
214218
github.com/schollz/progressbar/v3 v3.17.1 h1:bI1MTaoQO+v5kzklBjYNRQLoVpe0zbyRZNK6DFkVC5U=
215219
github.com/schollz/progressbar/v3 v3.17.1/go.mod h1:RzqpnsPQNjUyIgdglUjRLgD7sVnxN1wpmBMV+UiEbL4=
216-
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
217-
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
220+
github.com/segmentio/asm v1.2.1 h1:DTNbBqs57ioxAD4PrArqftgypG4/qNpXoJx8TVXxPR0=
221+
github.com/segmentio/asm v1.2.1/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
218222
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 h1:n661drycOFuPLCN3Uc8sB6B/s6Z4t2xvBgU1htSHuq8=
219223
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3/go.mod h1:A0bzQcvG0E7Rwjx0REVgAGH58e96+X0MeOfepqsbeW4=
220224
github.com/skeema/knownhosts v1.3.1 h1:X2osQ+RAjK76shCbvhHHHVl3ZlgDm8apHEHFqRjnBY8=
@@ -249,8 +253,8 @@ github.com/yuin/goldmark-emoji v1.0.5 h1:EMVWyCGPlXJfUXBXpuMu+ii3TIaxbVBnEX9uaDC
249253
github.com/yuin/goldmark-emoji v1.0.5/go.mod h1:tTkZEbwu5wkPmgTcitqddVxY9osFZiavD+r4AzQrh1U=
250254
github.com/zalando/go-keyring v0.2.6 h1:r7Yc3+H+Ux0+M72zacZoItR3UDxeWfKTcabvkI8ua9s=
251255
github.com/zalando/go-keyring v0.2.6/go.mod h1:2TCrxYrbUNYfNS/Kgy/LSrkSQzZ5UPVH85RwfczwvcI=
252-
github.com/zclconf/go-cty v1.16.2 h1:LAJSwc3v81IRBZyUVQDUdZ7hs3SYs9jv0eZJDWHD/70=
253-
github.com/zclconf/go-cty v1.16.2/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
256+
github.com/zclconf/go-cty v1.16.4 h1:QGXaag7/7dCzb+odlGrgr+YmYZFaOCMW6DEpS+UD1eE=
257+
github.com/zclconf/go-cty v1.16.4/go.mod h1:VvMs5i0vgZdhYawQNq5kePSpLAoz8u1xvZgrPIxfnZE=
254258
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
255259
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
256260
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

internal/auth0/quickstart.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ import (
99
"net/url"
1010
"os"
1111
"path"
12+
"strings"
1213

1314
"github.com/auth0/go-auth0/management"
1415

16+
"github.com/auth0/auth0-cli/internal/buildinfo"
17+
1518
"github.com/auth0/auth0-cli/internal/utils"
1619
)
1720

@@ -62,6 +65,9 @@ func (q Quickstart) Download(ctx context.Context, downloadPath string, client *m
6265
request.URL.RawQuery = params.Encode()
6366
request.Header.Set("Content-Type", "application/json")
6467

68+
userAgent := "Auth0 CLI" // Set User-Agent header using the standard CLI format.
69+
request.Header.Set("User-Agent", fmt.Sprintf("%v/%v", userAgent, strings.TrimPrefix(buildinfo.Version, "v")))
70+
6571
response, err := http.DefaultClient.Do(request)
6672
if err != nil {
6773
return err
@@ -71,6 +77,12 @@ func (q Quickstart) Download(ctx context.Context, downloadPath string, client *m
7177
return fmt.Errorf("expected status %d, got %d", http.StatusOK, response.StatusCode)
7278
}
7379

80+
// Check if we're getting a zip file or HTML response.
81+
contentType := response.Header.Get("Content-Type")
82+
if contentType != "" && !strings.Contains(contentType, "application/zip") && !strings.Contains(contentType, "application/octet-stream") {
83+
return fmt.Errorf("expected zip file but got content-type: %s. The quickstart endpoint may have returned an error page", contentType)
84+
}
85+
7486
tmpFile, err := os.CreateTemp("", "auth0-quickstart*.zip")
7587
if err != nil {
7688
return err

internal/cli/apis.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ func createAPICmd(cli *cli) *cobra.Command {
295295
api.TokenLifetime = auth0.Int(inputs.TokenLifetime)
296296
}
297297

298-
if inputs.SubjectTypeAuthorization != "{}" {
298+
if inputs.SubjectTypeAuthorization != "{}" && inputs.SubjectTypeAuthorization != "" {
299299
var subjectTypeAuth management.ResourceServerSubjectTypeAuthorization
300300
if err := json.Unmarshal([]byte(inputs.SubjectTypeAuthorization), &subjectTypeAuth); err != nil {
301301
return fmt.Errorf("invalid JSON for subject-type-authorization: %w", err)

internal/cli/cli.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,13 @@ func (c *cli) setupWithAuthentication(ctx context.Context) error {
111111
}
112112
}
113113

114+
if errors.Is(err, config.ErrMalformedToken) {
115+
return fmt.Errorf("authentication token is corrupted, please run: %s\n\n%s",
116+
ansi.Cyan("auth0 logout && auth0 login"),
117+
ansi.Yellow("Note: Token handling was enhanced in v1.18.0+ to prevent malformed tokens."),
118+
)
119+
}
120+
114121
api, err := initializeManagementClient(tenant.Domain, tenant.GetAccessToken())
115122
if err != nil {
116123
return err

internal/cli/terraform.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ func (i *terraformInputs) parseResourceFetchers(api *auth0.API) ([]resourceDataF
7373
fetchers = append(fetchers, &attackProtectionResourceFetcher{})
7474
case "auth0_branding":
7575
fetchers = append(fetchers, &brandingResourceFetcher{})
76+
case "auth0_branding_theme":
77+
fetchers = append(fetchers, &brandingThemeResourceFetcher{api})
7678
case "auth0_phone_provider":
7779
fetchers = append(fetchers, &phoneProviderResourceFetcher{api})
7880
case "auth0_client", "auth0_client_credentials":

internal/cli/terraform_fetcher.go

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import (
1212
)
1313

1414
var (
15-
defaultResources = []string{"auth0_action", "auth0_attack_protection", "auth0_branding", "auth0_phone_provider", "auth0_client", "auth0_client_grant", "auth0_connection", "auth0_custom_domain", "auth0_flow", "auth0_flow_vault_connection", "auth0_form", "auth0_email_provider", "auth0_email_template", "auth0_guardian", "auth0_log_stream", "auth0_network_acl", "auth0_organization", "auth0_pages", "auth0_prompt", "auth0_prompt_custom_text", "auth0_prompt_screen_renderer", "auth0_resource_server", "auth0_role", "auth0_self_service_profile", "auth0_tenant", "auth0_trigger_actions", "auth0_user_attribute_profile"}
15+
defaultResources = []string{"auth0_action", "auth0_attack_protection", "auth0_branding", "auth0_branding_theme", "auth0_phone_provider", "auth0_client", "auth0_client_grant", "auth0_connection", "auth0_custom_domain", "auth0_flow", "auth0_flow_vault_connection", "auth0_form", "auth0_email_provider", "auth0_email_template", "auth0_guardian", "auth0_log_stream", "auth0_network_acl", "auth0_organization", "auth0_pages", "auth0_prompt", "auth0_prompt_custom_text", "auth0_prompt_screen_renderer", "auth0_resource_server", "auth0_role", "auth0_self_service_profile", "auth0_tenant", "auth0_trigger_actions", "auth0_user_attribute_profile"}
1616
)
1717

1818
type (
@@ -37,6 +37,10 @@ type (
3737

3838
brandingResourceFetcher struct{}
3939

40+
brandingThemeResourceFetcher struct {
41+
api *auth0.API
42+
}
43+
4044
phoneProviderResourceFetcher struct {
4145
api *auth0.API
4246
}
@@ -139,6 +143,24 @@ func (f *brandingResourceFetcher) FetchData(_ context.Context) (importDataList,
139143
},
140144
}, nil
141145
}
146+
func (f *brandingThemeResourceFetcher) FetchData(ctx context.Context) (importDataList, error) {
147+
var data importDataList
148+
149+
theme, err := f.api.BrandingTheme.Default(ctx)
150+
if err != nil {
151+
if mErr, ok := err.(management.Error); ok && mErr.Status() == http.StatusNotFound {
152+
return nil, nil
153+
}
154+
return nil, err
155+
}
156+
157+
data = append(data, importDataItem{
158+
ResourceName: "auth0_branding_theme.default",
159+
ImportID: theme.GetID(),
160+
})
161+
162+
return data, nil
163+
}
142164

143165
func (f *phoneProviderResourceFetcher) FetchData(ctx context.Context) (importDataList, error) {
144166
var data importDataList
@@ -314,7 +336,7 @@ func (f *emailProviderResourceFetcher) FetchData(ctx context.Context) (importDat
314336
func (f *emailTemplateResourceFetcher) FetchData(ctx context.Context) (importDataList, error) {
315337
var data importDataList
316338

317-
templates := []string{`verify_email`, `reset_email`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `change_password`, `password_reset`}
339+
templates := []string{`verify_email`, `reset_email`, `welcome_email`, `blocked_account`, `stolen_credentials`, `enrollment_email`, `mfa_oob_code`, `change_password`, `password_reset`, `verify_email_by_code`, `reset_email_by_code`, `user_invitation`, `async_approval`}
318340

319341
for _, template := range templates {
320342
emailTemplate, err := f.api.EmailTemplate.Read(ctx, template)

0 commit comments

Comments
 (0)