A golang client adapter for Janssen Project services, starting with the jans-auth-server
[Go, golang, Janssen, Gluu, oxAuth, jans-auth-server]
For questions either raise an issue or visit the gopher-slack channel #gojans
Janssen (jans
for short) is a Linux Foundation project providing a cloud-native identity and access management (IAM) platform, building on code developed and donated by Gluu. If you are still considering possible alternatives, then you should read this opinion about what Redhat dropping CENTOS means for its sibling keycloak.
This adapter aims to ease the task of building golang clients which interact with jans
, in much the same way that gocloak does for keycloak. A key difference is that gojans
is auto-generated, whereas gocloak
is crafted by hand. The steps to create gojans
require some human intervention, so this repo exists to save you the hassle. The procedure is
- start with
openapi3.0
spec for Gluu oxAuth server 4.2, - convert to
openapi2.0/swagger2.0
using apimatic.io - modify by hand to clean up the naming and some type defintions
- generate client code with go-swagger
To use the client code in your project, import
import (
jac "github.com/timdrysdale/gojans/pkg/jansAuth/client"
jam "github.com/timdrysdale/gojans/pkg/jansAuth/models"
)
The swagger
files are in ./api/openapi-spec
. The client adapter code is in .pkg/jansAuth
. The project directory tree is:
.
├── api
│ └── openapi-spec
├── img
├── internal
│ └── curl
└── pkg
└── jansAuth
├── client
└── models
You can pre-run the linting with
golangci-lint run ./...
Using act
may fail on your local machine due to cgo dependencies.
Test with your own instantiation of the auth-server, or consider mocking (perhaps automatically with apisprout although it may require the examples to be updated for more complete testing).