Files
dc-bytedance a3c1c794eb feat(auth): add hidden export-scopes build tool for brand scopes JSON
Add a build-tag-gated (//go:build scopeexport) hidden `auth export-scopes
--brand feishu|lark` command that emits the brand scopes document
({version, scopes:{domain:{i18n_name,i18n_desc,tenant_scopes,user_scopes}}})
from the embedded API catalog, reusing auth login's own domain resolver so the
exported scopes and the login-recommended scopes stay a single source.

This gives downstream consumers of the brand scopes a stable, CI-covered
contract instead of reaching into unexported resolver internals: `make
test-scopeexport` builds the tagged binary and runs the contract tests on every
PR, so a refactor that breaks the export fails here rather than downstream.

Output is a byte-exact match for the JSON.stringify(x, null, 2)+"\n" encoding:
2-space indent, trailing newline, empty lists as [], no HTML escaping of and/lt/gt
characters, empty domains dropped, and batch-excluded scopes
(im:message.send_as_user) filtered through the CLI's own filterBatchExcludedScopes.
The command is excluded from released user binaries via a no-op registration in
non-scopeexport builds.
2026-09-10 15:02:02 +08:00
..