publishers
publishers copied to clipboard
Feat/migrate dashboard
👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎
This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.
The following commits were not verified: ba44a3901f2623316adc3d9fb72e8fd5b77a2afc (unsigned)
[puLL-Merge] - brave-intl/publishers@4393
Description
This PR adds several new API endpoints and features to the Publishers app, primarily focused on enabling publishers to manage their channels and crypto addresses. The main changes include:
- New
/api/nextv1/channels
endpoint for destroying channels - New
/api/nextv1/connection
endpoints for managing Bitflyer, Gemini, and Uphold connections - New
/api/nextv1/crypto_address_for_channels
endpoints for managing crypto addresses associated with channels - New
/api/nextv1/crypto_addresses
endpoint for managing a publisher's crypto addresses - New
/api/nextv1/home
endpoints for fetching publisher dashboard data - Addition of failed verification details and call-to-action on the
Channel
model - Updates to
publishers_helper
andsite_banners.yml
fixture
Changes
Changes
app/controllers/api/nextv1/channels_controller.rb
- Adds endpoint to destroy a channel belonging to the current publisher
app/controllers/api/nextv1/connection/*_connections_controller.rb
- Adds endpoints to manage Bitflyer, Gemini and Uphold connections for the current publisher
app/controllers/api/nextv1/crypto_address_for_channels_controller.rb
- Adds endpoints to manage crypto addresses associated with a specific channel
- Includes methods to verify Solana and Ethereum addresses
app/controllers/api/nextv1/crypto_addresses_controller.rb
- Adds endpoints to fetch and destroy crypto addresses belonging to the current publisher
app/controllers/api/nextv1/home_controller.rb
- Adds endpoints to fetch publisher dashboard data including channels, wallet info, and deposit dates
app/models/channel.rb
- Adds
failed_verification_details
andfailed_verification_call_to_action
methods to return user-friendly messages about why a channel failed verification
app/helpers/publishers_helper.rb
- Updates
next_deposit_date
to return date in "Month DD, YYYY" format
test/fixtures/site_banners.yml
- Adds fixture data for new default verified channel
Security Hotspots
None identified. The added API endpoints properly authenticate the current publisher and check ownership of resources before allowing create/update/delete operations.
The github comment above is correct that these are new files, but none of these are truly 'new' code. Everything referenced above is cut/pasted from an old controller almost verbatim, except for returning JSON instead of HTML.
The main exception is the dashboard
endpoint in the home controller. It combines code from the home
endpoint of publishers/app/controllers/publishers_controller.rb
and the show
code from publishers/app/controllers/publishers/wallets_controller.rb
. The wallets information from 'show' is left mostly untouched, and the publisher and channels information from 'home' have been edited to send only necessary information to the front end, rather than the whole of the publishers and channels objects.