-
Notifications
You must be signed in to change notification settings - Fork 41
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
add support for using either public_name or public_identifier #4490
base: staging
Are you sure you want to change the base?
Conversation
a25ed69
to
0604330
Compare
0604330
to
d3fc373
Compare
[puLL-Merge] - brave-intl/publishers@4490 DescriptionThis PR introduces custom vanity URLs for contribution pages and a system to manage reserved public names. It allows creators to set custom URLs for their contribution pages while maintaining security and uniqueness constraints. The changes also include an admin interface to manage reserved names and a temporary hold period for previously used names. Security Hotspots
ChangesChangesNew Files:
Modified Files:
sequenceDiagram
participant User
participant Frontend
participant API
participant Channel
participant ReservedNames
User->>Frontend: Enter custom URL
Frontend->>Frontend: Show confirmation modal
Frontend->>API: Request URL update
API->>Channel: Validate URL
Channel->>ReservedNames: Check if reserved
ReservedNames-->>Channel: Return status
Channel-->>API: Return validation result
API-->>Frontend: Return success/error
Frontend-->>User: Show result
|
private | ||
|
||
def set_reserved_public_name | ||
@reserved_public_name = ReservedPublicName.find(params[:id]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Found an unscoped find(...)
with user-controllable input. If the ActiveRecord model being searched against is sensitive, this may lead to Insecure Direct Object Reference (IDOR) behavior and allow users to read arbitrary records. Scope the find to the current user, e.g. current_user.accounts.find(params[:id])
.
Source: https://semgrep.dev/r/ruby.rails.security.brakeman.check-unscoped-find.check-unscoped-find
Cc @thypon @kdenhartog
@@ -95,6 +95,9 @@ export default function PublicChannelPage({publicIdentifier, previewMode}) { | |||
<div className={`${styles['privacy-disclaimer']}`}> | |||
{t('publicChannelPage.privacyDisclaimer')} | |||
</div> | |||
<div className={`${styles['privacy-disclaimer']}`}> | |||
{t('publicChannelPage.report_sus_urls')}<a target="_blank" rel="noopener noreferrer" href="https://support.brave.com/hc/en-us/requests/new">https://support.brave.com/hc/en-us/requests/new</a> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'publicChannelPage.report_sus_urls' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
|
||
return ( | ||
<div> | ||
<p className={styles['privacy-text']}>{t('contribution_pages.confirmation_text')}</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'contribution_pages.confirmation_text' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
style={{ margin: '10px 0px', width: '320px' }} | ||
kind='outline' | ||
> | ||
{t('shared.cancel')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'shared.cancel' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
style={{ margin: '10px 0px', width: '320px' }} | ||
kind='filled' | ||
> | ||
{t('shared.continue')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'shared.continue' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
<span slot='errors'>{publicNameError}</span> | ||
</Input> | ||
<div className='pb-3 color-tertiary'> | ||
{t('contribution_pages.public_url_note')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'contribution_pages.public_url_note' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
rel="noreferrer" | ||
href="https://support.brave.com/hc/en-us/articles/33646848629901-Creators-Custom-URLs-for-Contribution-Pages" | ||
> | ||
{t('contribution_pages.public_url_link')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'contribution_pages.public_url_link' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
> | ||
{t('contribution_pages.public_url_link')} | ||
</Link> | ||
{t('contribution_pages.public_url_note_2')} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] Translation key 'contribution_pages.public_url_note_2' should match format 'MODULE.FEATURE.*'
Source: https://semgrep.dev/r/typescript.react.portability.i18next.i18next-key-format.i18next-key-format
Cc @thypon @kdenhartog
@jlbyrne Text:
Modal:
On the contribution page itself:
|
Can we remove the space between for @jlbyrne Question: Given the cooldown on changing your URL, we should gray out the field and put different text if the user is still in cooldown period. Are we able to show exactly how many days are remaining? If so, then we should gray out the field and say:
|
So the cooldown period is for use of the custom url itself, across all users. A user can still change their url to something else. |
If a user has no cooldown on changing their URL, then can't they just run an attack and basically lock out every single possible URL? For example, every 1 second, I change my custom URL to something else, locking out all the custom URLs I touch for 1 month. @jlbyrne @kdenhartog |
That's correct. I could add in an additional cooldown per user if necessary? |
Yes, I think that is necessary. How about we make it 60 days? cc: @kdenhartog |
Resolves https://github.com/brave/roadmap/issues/1544
Resolves https://github.com/brave/reviews/issues/1709
Resolves https://github.com/brave-intl/creators-private-issues/issues/1885
Contribution page change:
![image](https://private-user-images.githubusercontent.com/4231556/409856236-6d3e046b-e6f4-4ba9-898e-9f2f0717294d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk1NTY0NDQsIm5iZiI6MTczOTU1NjE0NCwicGF0aCI6Ii80MjMxNTU2LzQwOTg1NjIzNi02ZDNlMDQ2Yi1lNmY0LTRiYTktODk4ZS05ZjJmMDcxNzI5NGQucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxNCUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTRUMTgwMjI0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9OWM3ZjVmOTEwYWFjMWNmYWQzYTkxYTc5Y2M3MmRjZmM1NWYwNDhkNmE1OTU3OGM3OThlYWVkYmVkMjAzNGQwYyZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.yR3sYJi5XaVDKTPAvSY9bZvAovzIkKhMvDCN1S3tx0U)
Admin Panel:
https://github.com/user-attachments/assets/4b37a378-0fbc-4503-b52b-73e46284e59b
Contribution Page Editor UI:
https://github.com/user-attachments/assets/2121fa28-6e8f-4041-bb18-52929734f9a5