Skip to content

ubccr/gomunge

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.