Documentation ¶
Overview ¶
Package token generates pseudo uddi tokens if credentials used match any storage.
Index ¶
Examples ¶
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.
Types ¶
type Credentials ¶
Credentials is the type used to pass username and password around.
func (*Credentials) Autenticato ¶ added in v1.3.0
func (c *Credentials) Autenticato(ctx context.Context) bool
Autenticato returns true if credentials are found in any storage.
Example ¶
var c = Credentials{User: "pippo", Hashpass: "f583ca884c1d93458fb61ed137ff44f6"} r := c.Autenticato(context.TODO()) fmt.Println(r)
Output: true
type CtxINTERFACE ¶ added in v1.3.1
type CtxINTERFACE string
CtxINTERFACE allows to inform all go routines.
Click to show internal directories.
Click to hide internal directories.