Skip to content

feat(auth): provide a product-owned fctl plugin - #162

Merged
flemzord merged 4 commits into
mainfrom
feat/auth-fctl-plugin
Oct 9, 2026
Merged

flemzord merged 4 commits into
mainfrom
feat/auth-fctl-plugin

Conversation

@flemzord

@flemzord flemzord commented Oct 9, 2026 •

Copy link
Copy Markdown
Member

Summary

Move Auth's fctl command contract into the product-owned misc/fctl-plugin module. fctl can embed this package or run its native executable without moving credentials, profiles or terminal behavior into the plugin.

fctl host -> public pluginsdk -> Auth plugin -> Auth API
                              └ native executable

The module retains all 12 Auth commands and declarative forms. GoReleaser builds Linux, macOS and Windows executables for amd64 and arm64, with exact service-version metadata and a separate plugin revision. Root validation recipes include the nested module.

On the next Auth v*.*.* tag containing these changes, release CI publishes all six raw OCI executables to ghcr.io/formancehq/fctl-plugin-auth using the job token with packages: write, then attaches fctl-plugin-catalogue.json to the GitHub release. Before the first upload, the publisher checks exact tag version, plugin revision, binary entry point, platform and checksum. Catalogue entries use immutable OCI digests.

Evidence

  • Before: Auth commands, payload validation and forms lived inside fctl.
    After: The independent module passes race tests, vet, lint and a public consumer dependency check, without fctl core or terminal dependencies. Coverage: 88.2% total.
  • An actual subprocess verifies the host HTTP broker, gateway prefix, exact JSON responses and validation before network access.
  • Snapshot packaging produced all six platform binaries, archives and checksums. The native executable reports the injected version and revision.
  • The branch is based on current Auth main and retains the shared Docker v2 release preset.
  • Actual GoReleaser output was published to a local OCI layout for all six platforms; race tests cover metadata mismatches and upload failures. Publisher lint/vet and GoReleaser configuration checks pass. No hosted registry upload or tagged release was run.

Merge Danger

Door: two-way

Blast Radius: CLI

No server behavior or data migration changes. Tagged release jobs gain GHCR publication and a catalogue release asset. On first publication, an administrator must make the GHCR package Public and verify anonymous downloads before catalogue promotion. Promotion into the official fctl catalogue remains separate. Maintenance release branches must contain these workflow/tooling changes before tagging.

@flemzord
flemzord requested review from a team as code owners October 9, 2026 15:21
Comment thread Justfile

# Independent Auth CLI/library module; no Auth server dependencies.
test-fctl-plugin:
@cd misc/fctl-plugin && go test -race ./...

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 [minor] Include plugin tests in the uploaded coverage reports

When just tests runs, test-fctl-plugin executes go test -race ./... without a coverage profile, while the subsequent root-module test writes only coverage.txt. As the README explicitly notes, root-module tests do not discover this nested module. Consequently the new plugin contributes no coverage data to the normal reporting path, so coverage regressions in it are invisible to the required coverage tracking despite its tests running.

Suggestion: Generate a separate atomic coverage profile for the nested module and include it in the CI coverage upload alongside the root profile. Keep race detection enabled and avoid having the root test overwrite the plugin profile.

@NumaryBot NumaryBot added risk: high NumaryBot classified this pull request as high risk. bot-reviewed review-inconclusive NumaryBot could not prove that the review gate is satisfied. labels Oct 9, 2026
@NumaryBot NumaryBot added risk: high NumaryBot classified this pull request as high risk. bot-reviewed review-inconclusive NumaryBot could not prove that the review gate is satisfied. and removed risk: high NumaryBot classified this pull request as high risk. bot-reviewed review-inconclusive NumaryBot could not prove that the review gate is satisfied. labels Oct 9, 2026
@flemzord
flemzord merged commit 556a4d4 into main Oct 9, 2026
13 of 16 checks passed
@flemzord
flemzord deleted the feat/auth-fctl-plugin branch October 9, 2026 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot-reviewed review-inconclusive NumaryBot could not prove that the review gate is satisfied. risk: high NumaryBot classified this pull request as high risk.

Development

Successfully merging this pull request may close these issues.

2 participants