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

Generate integrity sha384 for script #583

Closed
johansmitsnl opened this issue Jul 31, 2023 · 16 comments
Closed

Generate integrity sha384 for script #583

johansmitsnl opened this issue Jul 31, 2023 · 16 comments

Comments

@johansmitsnl
Copy link
Contributor

For the CSP it would be nice if we could generate the sha calculation to create better security of the files that needs to be loaded in javascript. https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity#subresource_integrity_with_the_script_element

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Aug 31, 2023
@johansmitsnl
Copy link
Contributor Author

Activity

@github-actions github-actions bot removed the Stale label Sep 1, 2023
@adryzz
Copy link
Contributor

adryzz commented Sep 2, 2023

I wanna try working on this and submitting a PR as soon as i'm done with my other PR.
does this rust playground snippet work?

also, it supports sha256, sha384 and sha512 hashes, i think we should implement them all.

@adryzz
Copy link
Contributor

adryzz commented Sep 2, 2023

ok so i feel like there should be both an opt-in per file and a global option (with per-file opt-out).

<link data-trunk rel="tailwind-css" href="src/tailwind.css" integrity="none"/>
<link data-trunk rel="tailwind-css" href="src/tailwind.css" integrity="sha256"/>
<link data-trunk rel="tailwind-css" href="src/tailwind.css" integrity="sha384"/>
<link data-trunk rel="tailwind-css" href="src/tailwind.css" integrity="sha512"/>

and then a --integrity option to set it globally?

i'll start working on this now as i feel like it's a nice addition, we'll see about naming changes when i'm actually done implementing it.

@johansmitsnl
Copy link
Contributor Author

@adryzz this looks good. Will this also apply for all the js and wasm glue to?

@adryzz
Copy link
Contributor

adryzz commented Sep 2, 2023

it will, but while i have basic functionality working, i need to make it all clean and working properly without any hacks before i submit the PR

@github-actions
Copy link

github-actions bot commented Oct 3, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Oct 3, 2023
@johansmitsnl
Copy link
Contributor Author

Not stale :)

@github-actions github-actions bot removed the Stale label Oct 4, 2023
Copy link

github-actions bot commented Nov 4, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Nov 4, 2023
@ctron
Copy link
Collaborator

ctron commented Nov 6, 2023

I will try get this implemented into trunk-ng, as we seem to have a need for this too.

@ctron
Copy link
Collaborator

ctron commented Nov 6, 2023

For the WASM and loader script, this is part of the trung-ng branch now: https://github.com/ctron/trunk … I might release this in the next few days with trunk-ng.

@github-actions github-actions bot removed the Stale label Nov 7, 2023
@johansmitsnl
Copy link
Contributor Author

@ctron when can we expect a release of trunk-ng?

@ctron
Copy link
Collaborator

ctron commented Nov 8, 2023

I just released 0.17.12 which contains this: https://github.com/ctron/trunk/releases/tag/v0.17.12

Copy link

github-actions bot commented Dec 9, 2023

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.

@github-actions github-actions bot added the Stale label Dec 9, 2023
@ctron ctron removed the Stale label Dec 12, 2023
@ctron
Copy link
Collaborator

ctron commented Dec 12, 2023

This got merged with #623 and it should be part of the next trunk release too.

@ctron
Copy link
Collaborator

ctron commented Dec 13, 2023

Released with trunk 0.18.0

@ctron ctron closed this as completed Dec 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants