Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bodgit/gssapi
Golang library providing a GSSAPI wrapper around gokrb5
https://github.com/bodgit/gssapi
go golang golang-library gssapi kerberos
Last synced: 14 days ago
JSON representation
Golang library providing a GSSAPI wrapper around gokrb5
- Host: GitHub
- URL: https://github.com/bodgit/gssapi
- Owner: bodgit
- License: bsd-3-clause
- Created: 2023-09-07T00:02:35.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-07-29T18:00:29.000Z (5 months ago)
- Last Synced: 2024-10-20T01:47:51.693Z (2 months ago)
- Topics: go, golang, golang-library, gssapi, kerberos
- Language: Go
- Homepage:
- Size: 80.1 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
[![GitHub release](https://img.shields.io/github/v/release/bodgit/gssapi)](https://github.com/bodgit/gssapi/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/bodgit/gssapi/build.yml?branch=main)](https://github.com/bodgit/gssapi/actions?query=workflow%3ABuild)
[![Coverage Status](https://coveralls.io/repos/github/bodgit/gssapi/badge.svg?branch=main)](https://coveralls.io/github/bodgit/gssapi?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/bodgit/gssapi)](https://goreportcard.com/report/github.com/bodgit/gssapi)
[![GoDoc](https://godoc.org/github.com/bodgit/gssapi?status.svg)](https://godoc.org/github.com/bodgit/gssapi)
![Go version](https://img.shields.io/badge/Go-1.22-brightgreen.svg)
![Go version](https://img.shields.io/badge/Go-1.21-brightgreen.svg)# GSSAPI wrapper for gokrb5
The [github.com/bodgit/gssapi](https://godoc.org/github.com/bodgit/gssapi)
package implements a GSSAPI-like wrapper around the
[github.com/jcmturner/gokrb5](https://github.com/jcmturner/gokrb5) package.Sample Initiator (Client):
```golang
package mainimport (
. "github.com/bodgit/gssapi"
"github.com/jcmturner/gokrb5/v8/gssapi"
)func main() {
initiator, err := NewInitiator(WithRealm("EXAMPLE.COM"), WithUsername("test"), WithKeytab[Initiator]("test.keytab"))
if err != nil {
panic(err)
}defer initiator.Close()
output, cont, err := initiator.Initiate("host/ssh.example.com", gssapi.ContextFlagInteg|gssapi.ContextFlagMutual, nil)
if err != nil {
panic(err)
}// transmit output to Acceptor
signature, err := initiator.MakeSignature(message)
if err != nil {
panic(err)
}// transmit message and signature to Acceptor
}
```Sample Acceptor (Server):
```golang
package mainimport (
. "github.com/bodgit/gssapi"
"github.com/jcmturner/gokrb5/v8/gssapi"
"github.com/jcmturner/gokrb5/v8/iana/nametype"
"github.com/jcmturner/gokrb5/v8/types"
)func main() {
principal := types.NewPrincipalName(nametype.KRB_NT_SRV_HST, "host/ssh.example.com")acceptor, err := NewAcceptor(WithServicePrincipal(&principal))
if err != nil {
panic(err)
}defer acceptor.Close()
// receive input from Initiator
output, cont, err := acceptor.Accept(input)
if err != nil {
panic(err)
}// transmit output back to Initiator
// receive message and signature from Initiator
if err := acceptor.VerifySignature(message, signature); err != nil {
panic(err)
}
}
```