Go bindings for MUNGE (MUNGE Uid 'N' Gid Emporium) an authentication service for creating and validating user credentials.
Requires CGO and libmunge to be installed.
Install using go tools:
$ go get github.com/ubccr/gomunge
Example:
package main
import (
"fmt"
"github.com/ubccr/gomunge"
)
func main() {
// Encode default cred
b64, err := munge.Encode()
// Encode cred with options
cred := munge.NewCredential(munge.WithPayload(payload), munge.WithTTL(800))
b64, err := cred.Encode()
// Use b64 in some transport
// Decode cred
cred, err := munge.Decode(b64)
fmt.printf("%s\n", cred.UidString())
}
gomunge is released under the GPLv3 license. See the LICENSE file.