authority

package
v0.0.0-...-271be40 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2016 License: GPL-2.0 Imports: 5 Imported by: 0

README

Grant/authenticate access to json obj by temporary KPASS uuid. Keys can be reset quickly with RPASS uuid. To be implemented in restful api which formats keys for delivery to users and authenticates a super user for adding and deleting records.

Authority takes a string and stores it in a text file with the filename KPASS.RPASS, where each PASS is a UUID string. Read requests are authorized for queries with a matching KPASS. Filenames are refreshed with new UUIDs when the RPASS is presented.

Authenticate(kpass string) ([]byte,error)

  • returns []byte data from file named KPASS.* if found

Authorize(obj string) (string,string)

  • stores obj in text file
  • generates two UUIDs for KPASS and RPASS
  • returns KPASS and RPASS

Regenerate(rpass string) (string,string)

  • renames file *.RPASS with newly generated KPASS and RPASS
  • returns KPASS and RPASS

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Authenticate

func Authenticate(kpass string) ([]byte, error)

Authenticate returns the contents of a text file named kpass.* If the file doesn't exist, returns "Access Denied" error

func Authorize

func Authorize(obj []byte) (string, string)

Authorize stores obj as text in a file named with two newly generated uuids Returns these uuids

Types

This section is empty.

Jump to

Keyboard shortcuts

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