Summary
The pkg server currently has its own api_keys table for API key validation (in pg-pkg/src/middleware/auth.rs). We need to migrate this to use the API keys managed by the postguard-business portal instead.
Details
- The business site generates API keys with the
PG- prefix (e.g., PG-<base64url>), see postguard-business/scripts/seed.ts.
- The pkg server currently validates keys against its own PostgreSQL
api_keys table (WHERE api_key = $1 AND expires_at > NOW()).
- Update the
PgApiKeyStore (or replace it) to validate against the postguard-business database/API keys table.
- The
PG- prefix needs to be accounted for in the key lookup logic.
- Consider whether pkg should query the business DB directly or call an API on the business service for key validation.
Related issues
/dobby please pick this up. Pull new commits and make new commits to the dobby repo often to tell other dobbies what you are up to, since several issues are interconnected. Tag @rubenhensen for anything you can't solve.
Summary
The pkg server currently has its own
api_keystable for API key validation (inpg-pkg/src/middleware/auth.rs). We need to migrate this to use the API keys managed by the postguard-business portal instead.Details
PG-prefix (e.g.,PG-<base64url>), seepostguard-business/scripts/seed.ts.api_keystable (WHERE api_key = $1 AND expires_at > NOW()).PgApiKeyStore(or replace it) to validate against the postguard-business database/API keys table.PG-prefix needs to be accounted for in the key lookup logic.Related issues
/dobby please pick this up. Pull new commits and make new commits to the dobby repo often to tell other dobbies what you are up to, since several issues are interconnected. Tag @rubenhensen for anything you can't solve.