Add support for domain metadata
in CustomDomain
struct, implement ListWithPagination
method, and update Management options with WithCustomDomainHeader
#551
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🔧 Changes
CustomDomain
struct.ListWithPagination
method to handle paginated results in domain listing.WithCustomDomainHeader
to allow setting a custom domain for requests.CustomDomainHeader
option to request options to apply a custom domain header on a per-request basis.🌟 Examples
Managing Custom Domain Metadata
You can associate custom metadata (key-value pairs) with your custom domains.
1. Creating a Custom Domain with Metadata
When creating a new custom domain, you can include a
DomainMetadata
field.2. Updating Custom Domain Metadata
You can update the metadata of an existing custom domain. To remove a metadata key, set its value to
nil
or an empty map if you want to clear all metadata.3. Listing Custom Domains with Pagination
The
ListWithPagination
method allows you to retrieve custom domains in pages, which is useful for tenants with a large number of custom domains. It uses checkpoint pagination.4. Using Custom Domain Headers
You can configure the SDK to send an
Auth0-Custom-Domain
header. This is useful in scenarios where Auth0 needs to know the original custom domain a request was intended for, especially for certain email templates or universal login flows.WithCustomDomainHeader
(Management Option)This option sets a custom domain header globally for all requests made by a management client instance. The header is only applied if the request path is whitelisted (e.g.,
/api/v2/users
,/api/v2/jobs/verification-email
).CustomDomainHeader
(Request Option)This option sets or overrides the
Auth0-Custom-Domain
header for a specific API request. It takes precedence over any globally set header viaWithCustomDomainHeader
and applies regardless of whether the endpoint is whitelisted for the global option.📚 References
🔬 Testing
ListWithPagination
method.WithCustomDomainHeader
and theCustomDomainHeader
in request options.📝 Checklist