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

Adding ability to restrict allowed characters in an asset id and allowing ( and ) #701

Merged
merged 16 commits into from
Jan 11, 2024

Conversation

JackLewis-digirati
Copy link
Contributor

@JackLewis-digirati JackLewis-digirati commented Jan 2, 2024

Resolves #340
Resolves #323

This pull request adds in the ability to restrict the characters allowed in an asset id. It does this by adding a set of 2 new settings:

"RestrictedAssetIdCharacters": "\\ "
"DisableStrictAssetIdChecks": true

RestrictedAssetIdCharacters is a series of characters that are not allowed within an asset id

DisableStrictAssetIdChecks sets whether the check for strict asset ids is disabled. As such, this check is enabled by default

Additionally, this pull request enables ( and ) characters to be used in the image id which would previously cause appetiser to fail. It manages this by replacing these characters with an alternative. By default this is an underscore, but can be set to a specific string via settings to be able to reduce the possibility of collisions

@JackLewis-digirati JackLewis-digirati changed the title initial commit adding strict asset id checks Adding strict asset id checks Jan 2, 2024
@JackLewis-digirati JackLewis-digirati changed the title Adding strict asset id checks Adding ability to restrict allowed characters in an asset id Jan 2, 2024
@JackLewis-digirati JackLewis-digirati marked this pull request as ready for review January 2, 2024 16:46
@JackLewis-digirati JackLewis-digirati requested a review from a team as a code owner January 2, 2024 16:46
@JackLewis-digirati JackLewis-digirati changed the title Adding ability to restrict allowed characters in an asset id Adding ability to restrict allowed characters in an asset id and allowing ( and ) Jan 4, 2024
Copy link
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

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

This doesn't appear to meet the criteria on #340.

Configuration includes a string that contains the permitted characters

This has a configuration that stores restricted characters

and also a flag to enable:
no restrictions
restriction for new assets but allow updates of existing
fail for updates too

This has a single boolean flag to enable/disable and doesn't appear to differentiate creation/update

Copy link
Member

@donaldgray donaldgray left a comment

Choose a reason for hiding this comment

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

Approved - just need to delete unused param

@JackLewis-digirati JackLewis-digirati force-pushed the feature/assetIdRestrictions branch from 5d41143 to 5224767 Compare January 11, 2024 16:11
@JackLewis-digirati JackLewis-digirati force-pushed the feature/assetIdRestrictions branch from 4b83a6a to f4a0dd1 Compare January 11, 2024 16:49
@JackLewis-digirati JackLewis-digirati merged commit 0e08154 into main Jan 11, 2024
9 checks passed
@JackLewis-digirati JackLewis-digirati deleted the feature/assetIdRestrictions branch January 11, 2024 17:42
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

Successfully merging this pull request may close these issues.

Enforce restrictions on Asset IDs Handle '(' and ')' characters in asset identifiers
4 participants