osin-storage

command module
v0.0.0-...-987a2ef Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2020 License: MIT Imports: 0 Imported by: 0

README

osin-storage

A storage backend for osin oauth2 with:

This project was inspired from ory-am

Addition features

  • Save map and struct meta information with JSON(or JSONB) for Client and Authorization
  • Use SaveClient() instead of CreateClient() and UpdateClient()
  • Add AllClients() [] interface for management
  • Add remember function for authorization

Prepare database

cat storage/database/oauth_schema.sql | docker exec -i osin-db psql -U osin

Example


import (
	"database/sql"

	_ "github.com/lib/pq"
	"github.com/liut/osin-storage/storage/sqlstore"
	"github.com/openshift/osin"
)

func main () {
	dsn := "postgres://osin:osin@127.0.0.1:5432/osin?sslmode=disable"
	db, err := sql.Open("postgres", dsn)
	if err != nil {
		log.Fatal(err)
	}

	store := sqlstore.New(db)
	server := osin.NewServer(newOsinConfig(), store)
}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package storage defines an interface, which all osin-storage implementations are going to support.
Package storage defines an interface, which all osin-storage implementations are going to support.
pg
Package pg is a osin storage implementation for postgres.
Package pg is a osin storage implementation for postgres.

Jump to

Keyboard shortcuts

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