Skip to content

Commit

Permalink
Add css class, remove upgrade-insecure-requests in dev
Browse files Browse the repository at this point in the history
  • Loading branch information
hursey013 committed Oct 30, 2024
1 parent 2a756bd commit e81bdd2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
4 changes: 4 additions & 0 deletions __tests__/middleware.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ describe('/login', () => {
expect(location).toMatch('state=baz');
expect(location).toMatch('response_type=code');
});

it('has CSP headers present', () => {
expect(response.headers.get('content-security-policy')).not.toBeNull();
});
});

describe('auth/login/callback', () => {
Expand Down
13 changes: 10 additions & 3 deletions src/assets/stylesheets/styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,14 @@
'palette-color-system-green-cool-vivid',
'palette-color-system-red-cool-vivid',
'palette-color-system-red-vivid'
// no trailing comma,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// no trailing comma,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
),

$border-color-palettes: (
'palette-color-system-green-cool',
'palette-color-system-red-vivid',
'palette-color-system-gray-cool'
// no trailing comma,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
// no trailing comma,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
),

$top-palettes: (
Expand Down Expand Up @@ -164,6 +164,9 @@
text-overflow: clip;
text-overflow: ellipsis;
}
.text-underline-offset {
text-underline-offset: 0.7em;
}

/* Custom selector styles */

Expand Down Expand Up @@ -429,7 +432,11 @@ $error-color-dark: 'red-40v';
// ProgressBar

.progress__bg--infinite {
background: linear-gradient(90deg, color('blue-cool-20v') 78.42%, color('blue-cool-30v') 100%);
background: linear-gradient(
90deg,
color('blue-cool-20v') 78.42%,
color('blue-cool-30v') 100%
);
}

.progress__infinity-logo {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Overlays/OverlayHeaderUsername.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function OverlayHeaderUsername({
}) {
return (
<>
<h2 className="margin-top-0 margin-bottom-7 text-uppercase text-light underline-base-light text-underline font-sans-xs">
<h2 className="margin-top-0 margin-bottom-7 text-uppercase text-light underline-base-light text-underline text-underline-offset font-sans-xs">
{header}
</h2>
{serviceAccount && (
Expand Down
2 changes: 1 addition & 1 deletion src/middlewares/withCSP.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export const withCSP: MiddlewareFactory = (next: NextMiddleware) => {
base-uri 'self';
form-action 'self';
frame-ancestors 'none';
upgrade-insecure-requests;
${process.env.NODE_ENV !== 'development' ? 'upgrade-insecure-requests;' : ''};
`;

// Replace newline characters and spaces
Expand Down

0 comments on commit e81bdd2

Please sign in to comment.