Fix Google OAuth: explicit IAM policy + strip OIDC scopes from credentials
This commit is contained in:
@@ -251,6 +251,12 @@ export class AgentClawStack extends cdk.Stack {
|
||||
googleOAuthClientSecret.grantRead(oauthHandlerFn);
|
||||
botTokenSecret.grantRead(oauthHandlerFn);
|
||||
usersTable.grantReadWriteData(oauthHandlerFn);
|
||||
// Explicit access to the OAuth client secret (fromSecretNameV2 wildcard may not resolve)
|
||||
oauthHandlerFn.addToRolePolicy(new iam.PolicyStatement({
|
||||
sid: 'GoogleOAuthClientSecretExact',
|
||||
actions: ['secretsmanager:GetSecretValue'],
|
||||
resources: ['arn:aws:secretsmanager:us-east-1:495395224548:secret:agent-claw/google-oauth-client-subXHl'],
|
||||
}));
|
||||
// Grant OAuth handler write access to per-user credential secrets
|
||||
oauthHandlerFn.addToRolePolicy(new iam.PolicyStatement({
|
||||
sid: 'PerUserGoogleCredentialsWrite',
|
||||
|
||||
Reference in New Issue
Block a user