totpapi

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2020 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Overview

Package totpapi provides an HTTP API for TOTP management.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewService

func NewService(options ...ConfigOption) auth.TOTPAPI

NewService returns a new implementation of auth.TOTPAPI.

func SetupHTTPHandler

func SetupHTTPHandler(svc auth.TOTPAPI, router *mux.Router, tokenSvc auth.TokenService, logger log.Logger, lmt httpapi.LimiterFactory)

SetupHTTPHandler converts a service's public methods to http handlers.

Types

type ConfigOption

type ConfigOption func(*service)

ConfigOption configures the service.

func WithLogger

func WithLogger(l log.Logger) ConfigOption

WithLogger configures the service with a logger.

func WithOTP

func WithOTP(o auth.OTPService) ConfigOption

WithOTP configures the service with an OTP management service.

func WithRepoManager

func WithRepoManager(repoMngr auth.RepositoryManager) ConfigOption

WithRepoManager configures the service with a new RepositoryManager.

func WithTokenService added in v0.2.0

func WithTokenService(t auth.TokenService) ConfigOption

WithTokenService configures the service with a TokenService.

type Response added in v0.3.0

type Response struct {
	TOTP string `json:"totp"`
}

Response is a success response with an embedded TOTP string.

Jump to

Keyboard shortcuts

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