Documentation ¶
Index ¶
- Constants
- func SetupRouter(r *mux.Router, config Config) (*tokenServerContext, error)
- type Config
- type DatabaseSession
- func (ds *DatabaseSession) AllocateUser(email string, generation uint64, clientState string) (*User, error)
- func (session *DatabaseSession) Close()
- func (ds *DatabaseSession) GetUser(email string) (*User, error)
- func (ds *DatabaseSession) UpdateUser(email string, newGeneration uint64, newClientState string) (*User, error)
- type TokenServerResponse
- type User
Constants ¶
View Source
const ( DEFAULT_PERSONA_VERIFIER = "https://verifier.accounts.firefox.com/v2" DEFAULT_PERSONA_AUDIENCE = "http://127.0.0.1" DEFAULT_ALLOW_NEW_USERS = true DEFAULT_TOKEN_DURATION = 300 DEFAULT_SHARED_SECRET = "ThisIsAnImportantSecretThatYouShouldChange" DEFAULT_STORAGESERVER_NODE = "http://127.0.0.1:8124/storage" DEFAULT_DATABASE_PATH = "/tmp/tokenserver.db" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { PersonaVerifier string PersonaAudience string AllowNewUsers bool TokenDuration int64 StorageServerNode string DatabasePath string }
func DefaultConfig ¶
func DefaultConfig() Config
type DatabaseSession ¶
type DatabaseSession struct {
// contains filtered or unexported fields
}
func NewDatabaseSession ¶
func NewDatabaseSession(path string) (*DatabaseSession, error)
func (*DatabaseSession) AllocateUser ¶
func (*DatabaseSession) Close ¶
func (session *DatabaseSession) Close()
func (*DatabaseSession) UpdateUser ¶
type TokenServerResponse ¶
type TokenServerResponse struct { Id string `json:"id"` // Signed authorization token Key string `json:"key"` // Secret derived from the shared secret Uid uint64 `json:"uid"` // The user id for this service ApiEndpoint string `json:"api_endpoint"` // The root URL for the user of this service Duration int64 `json:"duration"` // the validity duration of the issued token, in seconds }
Click to show internal directories.
Click to hide internal directories.