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/migrate dashboard #4393

Merged
merged 1 commit into from
May 30, 2024
Merged

Feat/migrate dashboard #4393

merged 1 commit into from
May 30, 2024

Conversation

jlbyrne
Copy link
Contributor

@jlbyrne jlbyrne commented Mar 19, 2024

Copy link

socket-security bot commented Apr 11, 2024

👍 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.

View full report↗︎

@jlbyrne jlbyrne force-pushed the feat/migrate-dashboard branch 3 times, most recently from 564ee35 to 8cb9745 Compare April 24, 2024 14:13
@jlbyrne jlbyrne marked this pull request as ready for review April 24, 2024 14:13
@jlbyrne jlbyrne requested a review from tsmartt April 24, 2024 14:14
Copy link

The following commits were not verified:
ba44a39 (unsigned)

Copy link

[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 and site_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 and failed_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.

@jlbyrne
Copy link
Contributor Author

jlbyrne commented May 29, 2024

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.

@jlbyrne jlbyrne merged commit cb61f3f into staging May 30, 2024
7 checks passed
@jlbyrne jlbyrne deleted the feat/migrate-dashboard branch May 30, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants