https://github.com/ubccr/goipa
FreeIPA client library in Go
https://github.com/ubccr/goipa
api freeipa go golang
Last synced: 3 months ago
JSON representation
FreeIPA client library in Go
- Host: GitHub
- URL: https://github.com/ubccr/goipa
- Owner: ubccr
- License: bsd-3-clause
- Created: 2015-05-12T14:20:44.000Z (about 10 years ago)
- Default Branch: main
- Last Pushed: 2024-12-12T00:05:26.000Z (7 months ago)
- Last Synced: 2025-04-02T04:08:31.293Z (3 months ago)
- Topics: api, freeipa, go, golang
- Language: Go
- Size: 80.1 KB
- Stars: 38
- Watchers: 7
- Forks: 38
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# goipa - FreeIPA client library
===============================================================================[](https://pkg.go.dev/github.com/ubccr/goipa)
goipa is a [FreeIPA](http://www.freeipa.org/) client library written in Go.
It interfaces with the FreeIPA JSON [api](https://github.com/freeipa/freeipa/blob/master/API.txt)
over HTTPS.## Usage
Install using go tools:
```
$ go get github.com/ubccr/goipa
```Example calling FreeIPA user-show:
```go
package mainimport (
"fmt""github.com/ubccr/goipa"
)func main() {
client := ipa.NewDefaultClient()err := client.LoginWithKeytab("/path/to/user.keytab", "username")
if err != nil {
panic(err)
}rec, err := client.UserShow("username")
if err != nil {
panic(err)
}fmt.Println("%s - %s", rec.Username, rec.Uid)
}
```## Hacking
Development and testing goipa uses docker-compose. The scripts to spin up a
FreeIPA test server in docker were copied/adopted from [this great repository](https://github.com/adelton/webauthinfra).
Most of the scripts in `container/` directory are written by Jan Pazdziora and
licensed under Apache 2.0 and modified for use with goipa.NOTE: The containers are NOT meant to be run in production and used solely for
development.To get started hacking on goipa and running the test suite:
```
$ cp .env.sample .env
[edit to taste. add passwords and ssh key]$ docker-compose build
$ docker-compose up -d
$ ssh -p 9022 localhost
$ kinit admin
$ cd /app
$ go test
```To run a specific test with trace debugging:
```
$ go test -v -run UserShow
```## License
goipa is released under a BSD style License. See the LICENSE file.