token

package module
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 24, 2019 License: MIT Imports: 12 Imported by: 0

README

token

Build Status Maintainability Test Coverage

checks on DB and json file for credentials, if found returns a pseudo UDDI token.

Documentation

Overview

Package token generates pseudo uddi tokens if credentials used match any storage.

Index

Constants

View Source
const QueryCredentials = "SELECT IF(COUNT(*),'true','false') FROM app.credentials WHERE username = ? AND password = ?"

QueryCredentials is a query that executed on DB returns true if both user and password are found in a record.

Variables

View Source
var CredentialsJSONFile = "credentialsdb.json"

CredentialsJSONFile is the json file containing credentials.

Functions

func CheckCredentialsDBCtx added in v1.2.0

func CheckCredentialsDBCtx(ctx context.Context, c *Credentials) (bool, error)

CheckCredentialsDBCtx looks for credentials in the DB.

func CheckLocalCredentials

func CheckLocalCredentials(ctx context.Context, c *Credentials) (bool, error)

CheckLocalCredentials verifies username and passwords on local json file.

func GenerateCtx added in v1.2.0

func GenerateCtx(ctx context.Context) (string, error)

GenerateCtx generates a token.

Types

type Credentials

type Credentials struct {
	User     string
	Hashpass string
}

Credentials is the type used to pass username and password around.

Jump to

Keyboard shortcuts

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