go-auth-backend

module
v0.0.0-...-31af939 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2018 License: MIT

README

go-auth-backend

Description

go-auth-backend contains a simple interface for building authentication plugins for Go servers.

Building

go get github.com/spatialcurrent/go-auth-backend

Usage

Server

backend, err := LoadFromPlugin("/path/to/custom/auth/plugin.so", "NewAuthenticationBackend")

Plugin

package main

import (
  "net/http"
)

import (
  "github.com/spatialcurrent/go-auth-backend/authbackend"
)

func NewAuthenticationBackend() authbackend.Backend {
  return &MyCustomAuthBackend{}
}

func (a *AuthenticationBackend) Type() string {
  return "My Custom Auth Backend"
}

func (a *AuthenticationBackend) Connect(options map[string]string) (error) {
...
}

func (a *AuthenticationBackend) AuthenticateRequest(r *http.Request) (bool, authbackend.User, authbackend.Team, error) {
...
}

Contributing

Spatial Current, Inc. is currently accepting pull requests for this repository. We'd love to have your contributions! Please see Contributing.md for how to get started.

License

This work is distributed under the MIT License. See LICENSE file.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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