Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[AssetMapper] Add integrity metadata to importmaps#60378

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
MatTheCat wants to merge3 commits intosymfony:7.4
base:7.4
Choose a base branch
Loading
fromMatTheCat:ticket_60362

Conversation

MatTheCat
Copy link
Contributor

@MatTheCatMatTheCat commentedMay 7, 2025
edited
Loading

QA
Branch?7.4
Bug fix?no
New feature?yes
Deprecations?no
IssuesFix#60362
LicenseMIT

Takes over#58722 because I missed it existed..!

@smnandre
Copy link
Member

If you want to check, started some work was done here#58722

(and was waiting for people to step in and help, so really glad you did here 👍 )

MatTheCat reacted with eyes emoji

@@ -25,6 +26,7 @@ class MappedAssetFactory implements MappedAssetFactoryInterface
{
private const PREDIGESTED_REGEX = '/-([0-9a-zA-Z]{7,128}\.digested)/';
private const PUBLIC_DIGEST_LENGTH = 7;
private const INTEGRITY_HASH_ALGORITHMS = ['sha256', 'sha384', 'sha512'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Do we really need multiple algorithms ?

Copy link
ContributorAuthor

@MatTheCatMatTheCatMay 17, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I think so: it’s required to supporthttps://w3c.github.io/webappsec-subresource-integrity/#agility, and people apparently don’t agree on what the default algorithm should be.

smnandre reacted with thumbs up emoji
->info('Array of algorithms used to compute importmap resources integrity.')
->beforeNormalization()->castToArray()->end()
->prototype('scalar')->end()
->defaultValue(['sha384'])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Suggested change
->defaultValue(['sha384'])
->defaultNull()

This would be a BC break imho.

But it will also slow down the build time / memory usage.. so I do not think this is something that should be enabled per default (like cors)

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Makes sense; guess the recipe would be a good place to put this default then?

smnandre reacted with thumbs up emoji
@MatTheCatMatTheCatforce-pushed theticket_60362 branch 3 times, most recently from365d76d tof401b42CompareMay 22, 2025 16:47
@OskarStark

This comment has been minimized.

@smnandre

This comment has been minimized.

@@ -25,6 +26,7 @@ class MappedAssetFactory implements MappedAssetFactoryInterface
{
private const PREDIGESTED_REGEX = '/-([0-9a-zA-Z]{7,128}\.digested)/';
private const PUBLIC_DIGEST_LENGTH = 7;
private const INTEGRITY_HASH_ALGORITHMS = ['sha256', 'sha384', 'sha512'];
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

These names are actually both the integrity prefix and the algorithm. For now they all match so as the list is private I guess we'll update it to a map if needed.

@fabpotfabpot modified the milestones:7.3,7.4May 26, 2025
@MatTheCatMatTheCatforce-pushed theticket_60362 branch 2 times, most recently from7f203cd to9fd9f8aCompareMay 29, 2025 08:11
alamiraultand others added3 commitsMay 29, 2025 14:02
…ult)This PR was merged into the 7.4 branch.Discussion----------Replace `get_class()` calls by `::class`| Q             | A| ------------- | ---| Branch?       | 7.4| Bug fix?      | no| New feature?  | no| Deprecations? | no| Issues        | Fix #... <!-- prefix each issue number with "Fix #", no need to create an issue if none exists, explain below instead -->| License       | MITReplace `get_class()` by `::class`It was already done in past insymfony#47401Commits-------e0a602b Replace get_class() calls by ::class
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@smnandresmnandresmnandre left review comments

@chalasrchalasrAwaiting requested review from chalasrchalasr is a code owner

Assignees
No one assigned
Projects
None yet
Milestone
7.4
Development

Successfully merging this pull request may close these issues.

[AssetMapper] Add integrity hashes to import maps
7 participants
@MatTheCat@smnandre@OskarStark@fabpot@carsonbot@alamirault@nicolas-grekas

[8]ページ先頭

©2009-2025 Movatter.jp