oauth

package
v0.0.0-...-e6a6799 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2021 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DBAddToken

func DBAddToken(db *sql.DB, token string, discord_uid string) (int, error)

DBAddToken adds a token to the database

func DBGetToken

func DBGetToken(db *sql.DB, id int) (string, error)

DBGetToken returns the token based on the user ID

Types

type Claims

type Claims struct {
	Id string
}

Claims implements jwt.Claims and holds the user ID embedded in the JWT

func (*Claims) GetID

func (sc *Claims) GetID() (int64, error)

GetID casts and returns the ID as an int64

func (*Claims) Valid

func (sc *Claims) Valid() error

Valid checks if the ID provided is convertable into an integer

type Module

type Module struct {
	// contains filtered or unexported fields
}

Module holds data for this module and implements the shodan.Module interface

func (*Module) Attach

func (m *Module) Attach(session shodan.Shodan) error

Attach attaches this module to a Shodan session

func (*Module) GetIdentifier

func (_ *Module) GetIdentifier() string

GetIdentifier returns the identifier for this module

type TokenInfo

type TokenInfo struct {
	AccessToken  string `json:"access_token"`
	TokenType    string `json:"token_type"`
	ExpiresIn    int    `json:"expires_in"`
	RefreshToken string `json:"refresh_token"`
	Scope        string `json:"scope"`
	Error        string `json:"error"`
}

TokenInfo represents the data returned by the OAuth 2 token exchange

Jump to

Keyboard shortcuts

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