webtokenservice

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package webtokenservice implements function for working with token in web version of github aggregator.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeleteToken

func DeleteToken(rw http.ResponseWriter, req *http.Request) error

DeleteToken deletes access token from cookie. If cookieutil.DeleteCookie occurs any error, this will be returned.

func GetToken

func GetToken(req *http.Request) (string, error)

GetToken returns decrypted access token from cookie. Access token is presented as string. If cookieutil.GetCookieValue or base64util.Decode or cryptoService.Decrypt or base64util.Encode occurs any error, this will be returned.

func SaveToken

func SaveToken(rw http.ResponseWriter, tkn string) error

SaveToken encrypts and saves access token to cookie. Access token should be presented as string. If base64util.Decode or cryptoService.Encrypt or base64util.Encode occurs any error, this will be returned.

func SetCryptoService

func SetCryptoService(algorithm string)

SetCryptoService sets crypto service for web token service. Algorithm should be presented as string.

func SetCryptoServiceIV

func SetCryptoServiceIV(IV []byte)

SetCryptoServiceIV sets IV for crypto service of web token service. IV should be presented as byte array.

func SetCryptoServiceKey

func SetCryptoServiceKey(key []byte)

SetCryptoServiceKey sets secret for crypto servivce of web token service. Key should be presented as byte array.

Types

This section is empty.

Jump to

Keyboard shortcuts

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