Checklist
Description
AUTH0_INCLUDED_CONNECTIONS is only applied on import. It has no effect on export, despite the documentation stating that it affects both.
docs/configuring-the-deploy-cli.md says:
When configured, only the connections listed by name will be included in export and import operations. All other connections in the tenant will be completely ignored.
Important: This setting affects all operations (export and import). Connections not in this list will not appear in exports and will not be modified during imports.
The import half is implemented and works. The export half is not implemented in any published version.
The value is read into assets.include.connections on both code paths, including inside dump():
// src/context/directory/index.ts:124-126 (inside dump)
this.assets.include = {
connections: this.config.AUTH0_INCLUDED_CONNECTIONS || [],
};
…but filterIncluded has exactly one call site, in the import path:
// src/tools/auth0/handlers/connections.ts:930-936
async processChanges(assets: Assets): Promise<void> {
...
const includedConnections = (assets.include && assets.include.connections) || [];
const excludedConnections = (assets.exclude && assets.exclude.connections) || [];
let changes = await this.calcChanges(assets);
changes = filterExcluded(changes, excludedConnections);
changes = filterIncluded(changes, includedConnections); // only call site
filterIncluded operates on CalculatedChanges ({del, update, create, conflicts}), a structure the export path never builds.
Both dump() implementations read assets.exclude and never assets.include:
// src/context/directory/handlers/connections.ts:69-75
// Filter excluded connections
const excludedConnections = (context.assets.exclude && context.assets.exclude.connections) || [];
if (excludedConnections.length) {
connections = connections.filter(
(connection) => !excludedConnections.includes(connection.name)
);
}
// -> every remaining connection is then written to disk
Same in src/context/yaml/handlers/connections.ts:56-62.
An exhaustive grep of src/ on master (a8a602f) shows four references total: two writes into assets.include, the mutual-exclusion validation against AUTH0_EXCLUDED_CONNECTIONS, and one read inside processChanges. Identical in 8.29.2, 8.41.0, and 9.0.0-beta.1.
This is a notable asymmetry, since AUTH0_EXCLUDED_CONNECTIONS — documented as the deprecated counterpart — did gain export filtering, along with folder pruning that preserves excluded connections' files across re-dumps.
Expectation
With AUTH0_INCLUDED_CONNECTIONS configured, a0deploy export writes only the listed connections, and leaves connections outside the list unmanaged — mirroring how AUTH0_EXCLUDED_CONNECTIONS behaves on export today.
This matters most for the use case the docs call out explicitly — "Managing only specific connections while preserving others (e.g., self-service SSO connections)". A keep-list is the only maintainable shape there: Self-Service SSO mints new connections with generated UUID names over time, so expressing the same intent via AUTH0_EXCLUDED_CONNECTIONS requires amending the exclude list every time a connection is created. And the two cannot be combined — src/context/index.ts:148 throws if both are set.
Concretely, on a tenant with 4 social/enterprise connections we manage plus 27 UUID-named samlp connections created by Self-Service SSO, export writes all 31 regardless of the include list.
Reproduction
-
On a tenant with more than one connection, configure only a subset:
{
"AUTH0_DOMAIN": "<tenant>.us.auth0.com",
"AUTH0_CLIENT_ID": "<client-id>",
"AUTH0_INCLUDED_CONNECTIONS": ["google-oauth2", "windowslive"]
}
-
Export:
a0deploy export --config_file=config.json --format=directory --output_folder=local
-
local/connections/ contains a .json file for every connection on the tenant, not just google-oauth2.json and windowslive.json.
Same result with --format=yaml — every connection appears under connections: in the output.
import correctly restricts changes to the two listed connections, so the discrepancy is export-only.
Deploy CLI version
8.41.0 (also verified on 8.29.2 and 9.0.0-beta.1)
Node version
22
Additional context
Happy to open a PR implementing the export-side filter in both the directory and yaml handlers, mirroring the existing exclude behaviour — including preserving files of unmanaged connections across re-dumps so the new pruning logic doesn't delete them. Let me know if you'd prefer the fix, or a documentation correction instead.
Checklist
Description
AUTH0_INCLUDED_CONNECTIONSis only applied onimport. It has no effect onexport, despite the documentation stating that it affects both.docs/configuring-the-deploy-cli.mdsays:The import half is implemented and works. The export half is not implemented in any published version.
The value is read into
assets.include.connectionson both code paths, including insidedump():…but
filterIncludedhas exactly one call site, in the import path:filterIncludedoperates onCalculatedChanges({del, update, create, conflicts}), a structure the export path never builds.Both
dump()implementations readassets.excludeand neverassets.include:Same in
src/context/yaml/handlers/connections.ts:56-62.An exhaustive grep of
src/onmaster(a8a602f) shows four references total: two writes intoassets.include, the mutual-exclusion validation againstAUTH0_EXCLUDED_CONNECTIONS, and one read insideprocessChanges. Identical in8.29.2,8.41.0, and9.0.0-beta.1.This is a notable asymmetry, since
AUTH0_EXCLUDED_CONNECTIONS— documented as the deprecated counterpart — did gain export filtering, along with folder pruning that preserves excluded connections' files across re-dumps.Expectation
With
AUTH0_INCLUDED_CONNECTIONSconfigured,a0deploy exportwrites only the listed connections, and leaves connections outside the list unmanaged — mirroring howAUTH0_EXCLUDED_CONNECTIONSbehaves on export today.This matters most for the use case the docs call out explicitly — "Managing only specific connections while preserving others (e.g., self-service SSO connections)". A keep-list is the only maintainable shape there: Self-Service SSO mints new connections with generated UUID names over time, so expressing the same intent via
AUTH0_EXCLUDED_CONNECTIONSrequires amending the exclude list every time a connection is created. And the two cannot be combined —src/context/index.ts:148throws if both are set.Concretely, on a tenant with 4 social/enterprise connections we manage plus 27 UUID-named
samlpconnections created by Self-Service SSO,exportwrites all 31 regardless of the include list.Reproduction
On a tenant with more than one connection, configure only a subset:
{ "AUTH0_DOMAIN": "<tenant>.us.auth0.com", "AUTH0_CLIENT_ID": "<client-id>", "AUTH0_INCLUDED_CONNECTIONS": ["google-oauth2", "windowslive"] }Export:
a0deploy export --config_file=config.json --format=directory --output_folder=locallocal/connections/contains a.jsonfile for every connection on the tenant, not justgoogle-oauth2.jsonandwindowslive.json.Same result with
--format=yaml— every connection appears underconnections:in the output.importcorrectly restricts changes to the two listed connections, so the discrepancy is export-only.Deploy CLI version
8.41.0 (also verified on 8.29.2 and 9.0.0-beta.1)
Node version
22
Additional context
Happy to open a PR implementing the export-side filter in both the
directoryandyamlhandlers, mirroring the existing exclude behaviour — including preserving files of unmanaged connections across re-dumps so the new pruning logic doesn't delete them. Let me know if you'd prefer the fix, or a documentation correction instead.