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

feat: custom env linking text #828

Closed

Conversation

zsaltys
Copy link
Contributor

@zsaltys zsaltys commented Oct 24, 2023

Feature or Bugfix

  • Feature

Detail

  • Adding a way to override env linking prerequisites for those that do not want to use manual steps and have other ways to achieve the same thing. You can see in this picture how we use it:
Screenshot 2023-10-24 at 16 02 49

Security

The only security concern is that there's an html value coming out of config.json which gets set as innerHTML. I don't think this would be an issue unless someone would find a way to override the config. value as an attack.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@zsaltys
Copy link
Contributor Author

zsaltys commented Oct 24, 2023

@noah-paige @dlpzx please review.. btw I can't set you as reviewers :)

@dlpzx
Copy link
Contributor

dlpzx commented Oct 26, 2023

Hi @zsaltys, thanks for opening a PR :) We will review with @maryamkhidir and @itsmo-amzn after v2.1.0 is released

@zsaltys
Copy link
Contributor Author

zsaltys commented Oct 26, 2023

@dlpzx thanks!

@anmolsgandhi anmolsgandhi added this to the v2.2.0 milestone Nov 7, 2023
@zsaltys
Copy link
Contributor Author

zsaltys commented Dec 4, 2023

@itsmo-amzn @maryamkhidir I will make a PR that uses DOMPurify and a new react component? Will that be acceptable to merge this in?

@maryamkhidir
Copy link
Contributor

@zsaltys Yes, that works

@anmolsgandhi anmolsgandhi modified the milestones: v2.2.0, v2.3.0 Dec 12, 2023
@zsaltys
Copy link
Contributor Author

zsaltys commented Dec 18, 2023

@maryamkhidir @itsmo-amzn I have added support for DOMPurify. I have close to no experience with React or NPM so apologies if I've made some mistakes. Please let me know if there's anything else I should fix.

@noah-paige noah-paige changed the base branch from v2m1m0 to main December 18, 2023 17:25
@noah-paige
Copy link
Contributor

Changed the target branch to main - will need to pull latest from main to resolve above conflicts before merging this PR

@maryamkhidir
Copy link
Contributor

@zsaltys Taking a look

export const SanitizedHTML = ({ dirtyHTML }) => {
const defaultOptions = {
ALLOWED_TAGS: ['b', 'i', 'em', 'strong', 'a'],
ALLOWED_ATTR: ['href']
Copy link
Contributor

@maryamkhidir maryamkhidir Dec 18, 2023

Choose a reason for hiding this comment

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

Are you expecting a link from the config? If not, I don't think you should allow href. Otherwise, it looks good.

Copy link
Contributor Author

@zsaltys zsaltys Dec 19, 2023

Choose a reason for hiding this comment

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

@maryamkhidir yes we are using links. That's the main reason I needed HTML support. We provide links for users to our internal systems so they know how to onboard data.all environments.

@dlpzx
Copy link
Contributor

dlpzx commented Dec 19, 2023

Thanks for picking it up @zsaltys, the PR also needs to be updates with the latest changes in main to avoid the conflicts before merge

@zsaltys zsaltys changed the base branch from main to v2m1m0 December 19, 2023 12:34
@zsaltys
Copy link
Contributor Author

zsaltys commented Dec 19, 2023

Re-raised this PR to the main branch: https://github.com/awslabs/aws-dataall/pull/934/files .. To avoid solving a huge merge conflict by changing the base on this branch.

@zsaltys zsaltys closed this Dec 19, 2023
@noah-paige noah-paige removed this from the v2.3.0 milestone Dec 20, 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

Successfully merging this pull request may close these issues.

7 participants