Skip to content

feat: add approved pool urls - #204

Merged
paragmore merged 6 commits into
tetherto:developfrom
shrutesh-tether:feat/pool-urls
Aug 28, 2026
Merged

feat: add approved pool urls#204
paragmore merged 6 commits into
tetherto:developfrom
shrutesh-tether:feat/pool-urls

Conversation

@shrutesh-tether

@shrutesh-tether shrutesh-tether commented Aug 27, 2026

Copy link
Copy Markdown

Ticket

  • In pushAction, convert the received poolUrlId into the actual pool url fetched from ork.
  • Disregard the url sent by the UI

@shrutesh-tether
shrutesh-tether marked this pull request as ready for review August 27, 2026 09:57

@paragmore paragmore left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

the approved-urls route side looks good, but I don't think the transform runs on real traffic — the action string and payload shape don't match what the UI/ork actually use. Details inline.


const transformPushActionPayload = (payload) => {
switch (payload.action) {
case 'REGISTER_CONFIG': {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

this case never matches real traffic — the UI sends registerConfig (ACTION_TYPES.REGISTER_POOL_CONFIG in app-ui resolves to that, same value the ork whitelists), not REGISTER_CONFIG. And the real payload nests the urls at params[0].data.poolUrls (ork's registerConfig destructures { type, data }), so even with the right string this reads one level too high and would throw ERR_INVALID_POOL_URLS — and the flat shape it writes back would then be rejected by ork with ERR_CONFIG_TYPE_INVALID. The tests pass because they send the same shape the transform expects rather than what AddPoolModal produces — worth adding one test with the exact UI payload.

return payload
}

default:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

updateConfig needs the same treatment — ork accepts data.poolUrls with any url string on update, so a config can be registered against an approved pool and then updated to an arbitrary url. Same for the batch route: pushActionsBatch forwards batchActionsPayload untouched and ork fans each entry into pushAction, so registerConfig can skip this transform entirely. Might be worth enforcing the allowlist in ork's _validatePoolConfigData instead — every path converges there.

const transformPushActionPayload = (payload) => {
switch (payload.action) {
case 'REGISTER_CONFIG': {
const [poolConfig] = payload.params

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

if params is missing or not an array this throws a bare TypeError (→ 500). An Array.isArray guard with an ERR_ code would match the rest of the handler.

Comment thread workers/lib/constants.js Outdated
paragmore
paragmore previously approved these changes Aug 27, 2026
@tekwani
tekwani marked this pull request as draft August 27, 2026 14:12
@shrutesh-tether
shrutesh-tether marked this pull request as ready for review August 28, 2026 04:05
Comment thread workers/lib/constants.js Outdated
@paragmore
paragmore merged commit 251dec1 into tetherto:develop Aug 28, 2026
6 checks passed
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.

3 participants