Skip to content

Commit

Permalink
fix aud check on pds mod service auth
Browse files Browse the repository at this point in the history
  • Loading branch information
dholms committed Mar 5, 2024
1 parent 81f9d69 commit 7be8445
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/pds/src/auth-verifier.ts
Original file line number Diff line number Diff line change
Expand Up @@ -259,9 +259,20 @@ export class AuthVerifier {
throw new AuthRequiredError('Untrusted issuer', 'UntrustedIss')
}
const payload = await this.verifyServiceJwt(reqCtx, {
aud: this.dids.entryway ?? this.dids.pds,
aud: null,
iss: [this.dids.modService, `${this.dids.modService}#atproto_labeler`],
})
if (
payload.aud !== this.dids.pds &&
(!this.dids.entryway || payload.aud !== this.dids.entryway)
) {
throw new AuthRequiredError(
'jwt audience does not match service did',
'BadJwtAudience',
)
}

payload.aud
return {
credentials: {
type: 'mod_service',
Expand Down

0 comments on commit 7be8445

Please sign in to comment.