Conch API

Logo

Datacenter build and management service

View the Project on GitHub joyent/conch-api

Conch::Route::User

SOURCE

https://github.com/joyent/conch-api/blob/master/lib/Conch/Route/User.pm

METHODS

routes

Sets up the routes for /user.

ROUTE ENDPOINTS

All routes require authentication.

GET /user/me

POST /user/me?send_mail=<1|0>

Optionally take the query parameter send_mail (defaults to 1) to send an email telling the user their account was updated.

POST /user/me/revoke?send_mail=<1|0>&login_only=<0|1>&api_only=<0|1>

Optionally accepts the following query parameters:

By default it will revoke both login/session and API tokens. api_only and login_only cannot both be 1.

POST /user/me/password?clear_tokens=<login_only|none|all>

Optionally takes a query parameter clear_tokens, to also revoke the session tokens for the user, forcing the user to log in again. Possible options are:

If the clear_tokens parameter is set to none then the user session will remain; otherwise, the user is logged out.

GET /user/me/settings

POST /user/me/settings

GET /user/me/settings/:key

POST /user/me/settings/:key

DELETE /user/me/settings/:key

GET /user/me/token

POST /user/me/token

GET /user/me/token/:token_name

DELETE /user/me/token/:token_name

GET /user/:target_user_id_or_email

POST /user/:target_user_id_or_email?send_mail=<1|0>

Optionally take the query parameter send_mail (defaults to 1) to send an email telling the user their account was updated.

DELETE /user/:target_user_id_or_email?clear_tokens=<1|0>

When a user is deleted, all role entries (build, organization) are removed and are unrecoverable.

Optionally takes a query parameter clear_tokens (defaults to 1), to also revoke all session tokens for the user forcing all tools to log in again.

POST /user/:target_user_id_or_email/revoke?login_only=<0|1>&api_only=<0|1>

Optionally accepts the following query parameters:

By default it will revoke both login/session and API tokens. If both api_only and login_only cannot both be 1.

DELETE /user/:target_user_id_or_email/password?clear_tokens=<login_only|none|all>&send_mail=<1|0>

Optionally accepts the following query parameters:

GET /user

POST /user?send_mail=<1|0>

Optionally takes a query parameter, send_mail (defaults to 1) to send an email to the user with the new password.

GET /user/:target_user_id_or_email/token

GET /user/:target_user_id_or_email/token/:token_name

DELETE /user/:target_user_id_or_email/token/:token_name

LICENSING

Copyright Joyent, Inc.

This Source Code Form is subject to the terms of the Mozilla Public License, v.2.0. If a copy of the MPL was not distributed with this file, You can obtain one at https://www.mozilla.org/en-US/MPL/2.0/.