macaroon-identity

module
v0.0.0-...-e2c280a Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2020 License: LGPL-3.0

README

Sample macaroon-based identity service

Build status Go Report Card GoDoc

A sample identity service based on macaroon using the "form" authentication mechanism with user/password based on a CSV file.

It provides two binaries:

  • macaroon-identity: server providing form-based authentication with user/password
  • test-macaroon-identity: a sample executable which features a client connecting to a service which requires authentication through a third-party authentication service (which is effectively macaroon-identity).

NOTE: the macaroon-identity server is meant as a sample service and not intended for any production use.

Install

With a GOPATH set, run

go get -v github.com/albertodonato/macaroon-identity/...

Run tests

To run tests, first install test dependencies with:

 go get -v -t github.com/albertodonato/macaroon-identity/...

then

 go test github.com/albertodonato/macaroon-identity/...

Running

The server needs a CSV file containing credentials in the form username,password,groups.

The groups column is a space-separated list of groups that the user is part of and it's optional.

echo 'user1,pass2,grp1 grp2' > credentials.csv
$GOPATH/bin/macaroon-identity

By default the server endpoint is http://localhost:8081.

Testing a request

The test-macaroon-identity command starts the identity service and a test service which responds to GET / requests , requiring authentication through the identity service.

If -auth-username and -auth-password options are passed, the command also issues a request to the target service, to test the authentication process.

Directories

Path Synopsis
Package authservice defines a Macaroon-based authentication service.
Package authservice defines a Macaroon-based authentication service.
cmd
Package credentials defines a Checker to hold and validate credentials.
Package credentials defines a Checker to hold and validate credentials.
Package httpservice defines an HTTP service.
Package httpservice defines an HTTP service.

Jump to

Keyboard shortcuts

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