chore(storage): bring provider_template to full Provider parity#695
Merged
Conversation
Template only stubbed 60 of 122 storage.Provider methods — files for client, organization, org_membership, org_domain, saml_idp, scim_endpoint, scim_group, trusted_issuer, webauthn_credential, federated_identity, audit_log, and health_check were never added after those features landed on the real providers (#580, #686, #691, #694). make generate-db-template handed contributors a struct that didn't compile against the interface. - add the 12 missing feature files as stubs, matching the existing file-per-feature layout of sql/mongodb - add GetUserByExternalID stub to user.go - add var _ storage.Provider = (*provider)(nil) to provider.go so future interface drift fails the build immediately instead of silently shipping an incomplete template Verified: make generate-db-template dbname=x now produces a package that builds and satisfies storage.Provider out of the box.
var _ storage.Provider = (*provider)(nil) in provider.go created an import cycle the moment a generated provider gets wired into storage.New() per CONTRIBUTING.md step 4: internal/storage would import the new db package, which imported internal/storage right back. Caught by simulating the full generate -> wire -> build flow, not just building the template in isolation. Move the check into interface_test.go as an external _test package (provider_template_test), which can import internal/storage without being part of the same build graph storage.New() pulls in. Verified: - go build ./... clean with a provider actually wired into storage.New() - go test ./internal/storage/db/provider_template/... fails to compile (not just fails at runtime) when a method is removed
pull Bot
pushed a commit
to bhardwajRahul/authorizer
that referenced
this pull request
Jul 22, 2026
Added to README: - WebAuthn / passkey login - Enterprise SSO (SAML 2.0 IdP & SP, OIDC broker, verified domains, home realm discovery) - SCIM 2.0 provisioning - Multi-tenant / org-scoped admin - Migration guides (planned) Added to CHANGELOG [Unreleased]: - Service accounts as FGA subjects (authorizerdev#665) - SAML ACS CSRF exemption fix (authorizerdev#666) - Trusted-issuer token review config (authorizerdev#667) - Session revocation on password reset (authorizerdev#669, authorizerdev#673) - Multi-tenant SSO phases (authorizerdev#672, authorizerdev#674, authorizerdev#675) - OIDC discovery caching + Twitter PKCE fix (authorizerdev#668) - WebAuthn passkey support (authorizerdev#671) - Per-user TOTP lockout + hashed recovery codes (authorizerdev#670) - Server-side user search + org membership (authorizerdev#678, authorizerdev#680) - Per-method MFA availability signals (authorizerdev#681) - Consolidated MFA redesign narrative (authorizerdev#682-686) - SAML 2.0 IdP role (authorizerdev#691) - OAuth 2.1 / MCP hardening (authorizerdev#693) - SCIM group provisioning + FGA + SAML assertions (authorizerdev#694) - Provider template parity (authorizerdev#695) - Recent fixes (async tracking, AGENTS.md rules, security fixes, storage parity, error typing, panics, frontend fixes) (authorizerdev#696-702)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
internal/storage/db/provider_template/(generated bymake generate-db-template) only stubbed 60 of the 122 methods onstorage.Provider. It never got the files added after client/organization/SAML/SCIM/webauthn/audit-log/health-check landed on the real providers (#580, #686, #691, #694). Anyone scaffolding a new DB provider withmake generate-db-template dbname=foogot a struct that doesn't satisfy the interface, with no compiler error pointing at what's missing.client.go,organization.go,org_membership.go,org_domain.go,saml_idp.go,scim_endpoint.go,scim_group.go,trusted_issuer.go,webauthn_credential.go,federated_identity.go,audit_log.go,health_check.go), matching the file-per-feature layout used bysql/mongodbGetUserByExternalIDstub touser.govar _ storage.Provider = (*provider)(nil)toprovider.goso future interface drift fails the build immediately instead of shipping a silently incomplete templateCONTRIBUTING.mdwith the full feature checklist, a reference-provider guide (SQL-like vs document vs wide-column vs key-value), and the wiring/testing steps after the stubs are implementedTest plan
go build ./...passesgo vet ./internal/storage/db/provider_template/...andgofmt -lcleangolangci-lint run ./internal/storage/...— 0 issuesmake generate-db-template dbname=x, confirmed the generated package builds and satisfiesstorage.Providerwith no code changes