rest

package
v0.0.0-...-d933f62 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2018 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package rest implement the callback required by the oauth2 package

Package rest implement the callback required by the oauth2 package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(server *osin.Server, service ServiceInterface) *rest

New return a new rest instance

Types

type RequestDTOUserCredentials

type RequestDTOUserCredentials struct {
	Method   string `json:"method"`
	Username string `json:"username"`
	Password string `json:"password"`
}

RequestDTOUserCredentials is the object to map JSON request body of a login request

type ResponseDTOUserInfo

type ResponseDTOUserInfo struct {
	UserId uint   `json:"user_id"`
	Email  string `json:"email"`
}

ResponseDTOUserInfo is the object to map JSON response body of a request to get user basic info

type ServiceInterface

type ServiceInterface interface {
	AskUserServiceToCheckCredentials(username string, password string, method string) (ResponseDTOUserInfo, *apihelper.ApiErrors)
	GetResourceOwnerId(token string) (ResponseDTOUserInfo, *servicehelper.Error)
}

ServiceInterface is the model for the service package of oauth2

Jump to

Keyboard shortcuts

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