semuxproject / semux-core

Semux Core
https://www.semux.org
MIT License
76 stars 32 forks source link

API: divide APIs into groups #267

Closed semuxgo closed 4 years ago

semuxgo commented 4 years ago

Description

This PR assigns endpoints to different categories, which include

Additional changes are also included:

Test Plan

Existing tests

Related issues and/or PRs

N/A

orogvany commented 4 years ago

Maybe consider taking method 'safety' into consideration to better support what uses local wallet and what is gneric. Current public apis have to whitelist/blacklist based on which they choose that can be public

orogvany commented 4 years ago

Or make 'local wallet' only API separate port/config option to aid in spinning up a consistent public facing api

semuxgo commented 4 years ago

Good point. I briefly looked at the HTTP method types being used. 99% of the GET methods are safe to be exposed to public.

If we're okay with the following definition:

we can then add a flag to allow users to enable GET methods only if they want to make a public facing API.

orogvany commented 4 years ago

Hm. I don't think submit raw tx can be a GET due to url length? But I like where this isngoing

semuxgo commented 4 years ago

Bumped the HTTP request size limits. Commit: 51fb2c186120785202d6541ecdfb50e714029bb9

Tested, working with both Java Client and Chrome.

orogvany commented 4 years ago

Ah. Ok. Thanks