Skip to content

Commit

Permalink
Merge branch 'main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-durbin authored Sep 4, 2024
2 parents 90fd38a + 4f70679 commit 579e0de
Show file tree
Hide file tree
Showing 6 changed files with 4,058 additions and 4,189 deletions.
5 changes: 0 additions & 5 deletions services/harmony/.nsprc
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,6 @@
"notes": "Will fix in HARMONY-1729",
"expiry": "2024-11-01"
},
"1097493": {
"active": true,
"notes": "ignored because it doesn't affect us and there is not current patch",
"expiry": "2024-11-01"
},
"1097346": {
"active": true,
"notes": "ignored because it doesn't affect us and there is not current patch",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import simpleOAuth2, { OAuthClient, Token } from 'simple-oauth2';
import { RequestHandler, NextFunction } from 'express';
import { cookieOptions, setCookiesForEdl } from '../util/cookies';
import { listToText } from '@harmony/util/string';
import { hasCookieSecret } from '../util/cookie-secret';
import { ForbiddenError, RequestValidationError } from '../util/errors';
import HarmonyRequest from '../models/harmony-request';
import env from '../util/env';
Expand Down Expand Up @@ -170,8 +171,10 @@ export default function buildEdlAuthorizer(paths: Array<string | RegExp> = []):
return async function earthdataLoginAuthorizer(req: HarmonyRequest, res, next): Promise<void> {
const oauth2 = simpleOAuth2.create(oauthOptions);
const { token } = req.signedCookies;
const requiresAuth = paths.some((p) => req.path.match(p)) && !req.authorized
&& req.method.toUpperCase() != 'PUT'; // we don't support PUT requests with the redirect
const requiresAuth = paths.some((p) => req.path.match(p)) &&
!req.authorized &&
req.method.toUpperCase() != 'PUT' && // we don't support PUT requests with the redirect
!(req.path.toLowerCase().startsWith('/service-deployments-state') && hasCookieSecret(req));
let handler;

try {
Expand Down
2 changes: 1 addition & 1 deletion services/harmony/app/routers/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ const authorizedRoutes = [
'/service-results/*',
'/workflow-ui*',
'/service-image*',
'/service-deployment\//*',
'/service-deployment*',
'/ogc-api-edr/.*/collections/*',
];

Expand Down
Loading

0 comments on commit 579e0de

Please sign in to comment.