Concorda / concorda-server

MIT License
8 stars 2 forks source link

Version the API to v1 so we can build a v2 later #60

Closed AdrianRossouw closed 8 years ago

AdrianRossouw commented 8 years ago

The current API is mostly provided by seneca-auth, as exposed by seneca-web. One of the tasks we have for v2 is to build a proper first-class API in it's place.

To allow us to build the client library first, and then switch over to our new backend api, means we will need to version the current api under /api/v1 first.

mirceaalexandru commented 8 years ago

It will change like this:

/api/.... -> /api/v1/admin/.... /auth/.... -> /api/v1/auth/...

AdrianRossouw commented 8 years ago

that's perfect @mirceaalexandru

mirceaalexandru commented 8 years ago

/api/.... -> /api/v1/admin/.... - administraton API /auth/.... -> /api/v1/auth/... - authentication API /something_else/.... -> /api/v1/something_else/... - unrestricted/public API

mirceaalexandru commented 8 years ago

@AdrianRossouw here is a list of Hapi endpoints, v1:

Auth:

post /api/v1/auth/register
get /api/v1/auth/user
post /api/v1/auth/user
post /api/v1/auth/create_reset
post /api/v1/auth/load_reset
post /api/v1/auth/execute_reset
post /api/v1/auth/confirm
post /api/v1/auth/update_user
post /api/v1/auth/change_password
get /api/v1/auth/logout
post /api/v1/auth/logout
get /api/v1/auth/login
post /api/v1/auth/login

User:

post /api/v1/admin/user/{user_id}/session/close
get /api/v1/admin/user
get /api/v1/admin/user/{userId}
post /api/v1/admin/user
put /api/v1/admin/user
delete /api/v1/admin/user/{userId}
post /api/v1/admin/invite/user
get /api/v1/validate/{userId}

Groups:

post /api/v1/admin/user/{userId}/groups
put /api/v1/admin/user/{userId}/groups
get /api/v1/admin/group
get /api/v1/admin/groups

Applications

post /api/v1/admin/user/{userId}/clients
put /api/v1/admin/user/{userId}/clients
get /api/v1/admin/client
get /api/v1/admin/client/{clientId}
get /api/v1/admin/clients
post /api/v1/admin/client
put /api/v1/admin/client
delete /api/v1/admin/client/{clientId}

Settings:

get /api/v1/admin/settings
post /api/v1/admin/settings
put /api/v1/admin/settings