From f8559381eb72d28eb66291e29dffe4bfae28acc7 Mon Sep 17 00:00:00 2001 From: Devin Ivy Date: Mon, 26 Feb 2024 16:00:02 -0500 Subject: [PATCH] remove ozone test codepaths for appview v2 --- packages/ozone/src/auth.ts | 6 +----- packages/ozone/tests/moderation.test.ts | 2 +- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/packages/ozone/src/auth.ts b/packages/ozone/src/auth.ts index 697f673f2b7..e996f068c49 100644 --- a/packages/ozone/src/auth.ts +++ b/packages/ozone/src/auth.ts @@ -7,7 +7,6 @@ import { OzoneSecrets } from './config' const BASIC = 'Basic ' const BEARER = 'Bearer ' -// @NOTE this is not safe for production! it has been modified for testing purposes to sidestep jwt auth, allow providing a did directly. export const authVerifier = ( idResolver: IdResolver, opts: { aud: string | null }, @@ -28,10 +27,7 @@ export const authVerifier = ( if (!jwtStr) { throw new AuthRequiredError('missing jwt', 'MissingJwt') } - - const payload = jwtStr.startsWith('did:') - ? { iss: jwtStr } - : await verifyJwt(jwtStr, opts.aud, getSigningKey) + const payload = await verifyJwt(jwtStr, opts.aud, getSigningKey) return { credentials: { did: payload.iss }, artifacts: { aud: opts.aud } } } } diff --git a/packages/ozone/tests/moderation.test.ts b/packages/ozone/tests/moderation.test.ts index e20157428c4..c2f8df0ae12 100644 --- a/packages/ozone/tests/moderation.test.ts +++ b/packages/ozone/tests/moderation.test.ts @@ -907,7 +907,7 @@ describe('moderation', () => { }) }) - // @TODO add back in with image invalidation + // @TODO add back in with image invalidation, see bluesky-social/atproto#2087 it.skip('prevents image blob from being served, even when cached.', async () => { const fetchImage = await fetch(imageUri) expect(fetchImage.status).toEqual(404)