Skip to content

Latest commit

 

History

History
49 lines (32 loc) · 938 Bytes

README.md

File metadata and controls

49 lines (32 loc) · 938 Bytes

gomunge - Go bindings for MUNGE

GoDoc

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.

Usage

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())
}

License

gomunge is released under the GPLv3 license. See the LICENSE file.