Documentation ¶
Overview ¶
actions/auth.go
Index ¶
- Variables
- func App() *buffalo.App
- func AuthGetInitialTokens(c buffalo.Context) error
- func AuthMiddleware(next buffalo.Handler, params ...bool) buffalo.Handler
- func AuthOAuthCallback(c buffalo.Context) error
- func AuthRefreshToken(c buffalo.Context) error
- func AuthResetSignUp(c buffalo.Context) error
- func FilesDeleteFile(c buffalo.Context) error
- func FilesSaveFile(c buffalo.Context) error
- func FilesServeFile(c buffalo.Context) error
- func GraphqlIndex(c buffalo.Context) error
- func HomeHandler(c buffalo.Context) error
- func UsersConfirmKeysSeen(c buffalo.Context) error
- func UsersGetConfirmationKeys(c buffalo.Context) error
Constants ¶
This section is empty.
Variables ¶
var ENV = envy.Get("GO_ENV", "development")
ENV is used to help switch settings based on where the application is being run. Default is "development".
Functions ¶
func App ¶
App is where all routes and middleware for buffalo should be defined. This is the nerve center of your application.
Routing, middleware, groups, etc... are declared TOP -> DOWN. This means if you add a middleware to `app` *after* declaring a group, that group will NOT have that new middleware. The same is true of resource declarations as well.
It also means that routes are checked in the order they are declared. `ServeFiles` is a CATCH-ALL route, so it should always be placed last in the route declarations, as it will prevent routes declared after it to never be called.
func AuthGetInitialTokens ¶
* * @api {get} /auth/access/:session_identifier Sign up JWT * @apiName GetUnconfirmedJWT * @apiDescription Gets JWT and refresh token after OAuth sign up @apiGroup Auth * * @apiParam {String} session_identifier session unique indentifier * * @apiSuccess {String} token JWT * @apiSuccess {Number} expires_at UNIX expires at * @apiSuccess {String} refresh_token token used to get new JWT * @apiSuccess {String} user_id the uuid of the user connected to the session * @apiSuccess {Boolean} profile_confirmed if true the user has confirmed keys seen and received * * @apiError (404) SessionNotFund Session with identifier <code>session_identifier</code> was not found. **
func AuthMiddleware ¶
AuthMiddleware - requires JWT params - true = do not require the user to be confirmed
func AuthOAuthCallback ¶
* Receives OAuth and sends keys
func AuthRefreshToken ¶
* * @api {post} /auth/token Refresh the JWT * @apiName RefreshJWT * @apiDescription Gets new refresh token and JWT * @apiGroup Auth * * @apiParam (Body) {String} refresh_token the refresh token of the previous session * @apiParam (Body) {String} user_id the id of the logged in user * * @apiSuccess {String} token JWT * @apiSuccess {Number} expires_at UNIX expires at * @apiSuccess {String} refresh_token token used to get new JWT * @apiSuccess {Boolean} profile_confirmed if true the user has confirmed keys seen and received` * * @apiError (404) UserNotFund User with id <code>user_id</code> was not found. * @apiError (404) SessionNotFund Session for user with <code>user_id</code> was not found. * @apiError (406) InvalidRefreshToken <code>refresh_token</code> did not match the last session. **
func AuthResetSignUp ¶
* * @api {post} /auth/reset Resets signUP * @apiName ResetAuth * @apiDescription Resets the registration process in case of error * @apiGroup Auth * * @apiParam (Body) {String} [session_identifier] the refresh token of the previous session * @apiParam (Body) {String} [user_id] the id of the user * * * @apiError (403) AccountConfirmed The account associated with the user was confirmed * @apiError (404) SessionNotFund Session for user with <code>user_id</code> was not found. * @apiError (406) CannotDeleteUser Unknown error **
func FilesDeleteFile ¶
FilesDeleteFile removes file on disk (or ftp) and deletes data entry from the DB
func FilesSaveFile ¶
FilesSaveFile stores file on disk (or ftp) and makes data entry in the DB
func FilesServeFile ¶
FilesServeFile used as protected file server
func HomeHandler ¶
HomeHandler is a default handler to serve up a home page.
func UsersConfirmKeysSeen ¶
* * @api {post} /user/confirm/keys Confirm keys seen * @apiName confirmKeys * @apiPermission protected unverified * @apiDescription Checks the seen column for the keys in the DB and returns new, verified JWT and refresh token * @apiGroup User * * @apiParam (Body) {String} keys the keys received * * @apiSuccess {String} token JWT * @apiSuccess {Number} expires_at UNIX expires at * @apiSuccess {String} refresh_token token used to get new JWT * * @apiError (406) KeysDoNotMatch <code>keys</code> are not the ones sent *
func UsersGetConfirmationKeys ¶
* * @api {get} /user/keys Get unique user keys * @apiName getKeys * @apiPermission protected unverified * @apiDescription Gets unique keys that the user needs to save securely himself * @apiGroup User * * @apiSuccess {String} keys List of keys separated by " " * * @apiError (403) KeysAlreadySent Keys have been marked as <code>sent</code> *
Types ¶
This section is empty.