actions

package
v0.0.0-...-2c98600 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 28, 2021 License: MIT Imports: 34 Imported by: 0

Documentation

Overview

actions/auth.go

Index

Constants

This section is empty.

Variables

View Source
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

func App() *buffalo.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

func AuthGetInitialTokens(c buffalo.Context) error

* * @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

func AuthMiddleware(next buffalo.Handler, params ...bool) buffalo.Handler

AuthMiddleware - requires JWT params - true = do not require the user to be confirmed

func AuthOAuthCallback

func AuthOAuthCallback(c buffalo.Context) error

* Receives OAuth and sends keys

func AuthRefreshToken

func AuthRefreshToken(c buffalo.Context) error

* * @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

func AuthResetSignUp(c buffalo.Context) error

* * @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

func FilesDeleteFile(c buffalo.Context) error

FilesDeleteFile removes file on disk (or ftp) and deletes data entry from the DB

func FilesSaveFile

func FilesSaveFile(c buffalo.Context) error

FilesSaveFile stores file on disk (or ftp) and makes data entry in the DB

func FilesServeFile

func FilesServeFile(c buffalo.Context) error

FilesServeFile used as protected file server

func GraphqlIndex

func GraphqlIndex(c buffalo.Context) error

GraphqlIndex default implementation.

func HomeHandler

func HomeHandler(c buffalo.Context) error

HomeHandler is a default handler to serve up a home page.

func UsersConfirmKeysSeen

func UsersConfirmKeysSeen(c buffalo.Context) error

* * @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

func UsersGetConfirmationKeys(c buffalo.Context) error

* * @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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL