Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PCC-1332 Set PCC-GRANT cookie very permissively. Update github action version. #283

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/young-maps-fly.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@pantheon-systems/pcc-sdk-core": patch
---

PCC-GRANT (preview token) cookie now set with most relaxed security so that preview-pages can be shown in iframes.
2 changes: 1 addition & 1 deletion .github/workflows/changeset.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: checkout code repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: setup node.js
Expand Down
3 changes: 2 additions & 1 deletion packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
### Patch Changes

- 0c75736: CLI replaces "--version" command with "version"
- 1fd7c4d: Added support for setting preferred webhook events. Webhook notifications will only be sent on events matching preferred events
- 1fd7c4d: Added support for setting preferred webhook events. Webhook
notifications will only be sent on events matching preferred events
- Updated dependencies [183ad17]
- @pantheon-systems/[email protected]

Expand Down
2 changes: 1 addition & 1 deletion packages/core/__tests__/core/pantheon-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ describe("Request Handling", () => {
);

expect(mockResponse.setHeader).toHaveBeenCalledWith("Set-Cookie", [
"PCC-GRANT=test-grant; Path=/; SameSite=Lax",
"PCC-GRANT=test-grant; Path=/; SameSite=None;Secure;",
]);
});

Expand Down
5 changes: 4 additions & 1 deletion packages/core/src/core/pantheon-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ export const PantheonAPI = (givenOptions?: PantheonAPIOptions) => {

// Set or delete the PCC-GRANT cookie.
if (pccGrant) {
await setCookie(res, `PCC-GRANT=${pccGrant}; Path=/; SameSite=Lax`);
await setCookie(
res,
`PCC-GRANT=${pccGrant}; Path=/; SameSite=None;Secure;`,
);
} else if (
options?.getSiteId != null &&
req.cookies?.["PCC-GRANT"] != null
Expand Down
Loading