- Go
- itsme-golang (for now as it's not yet publicly available)
To start using this, make sure to add this repository to your GOPATH, more information on that can be found here.
To share the core ITSME OIDC logic to the multitude of generated packages, we use Go to create the logic, then create a shared C library which is the used to create binding with in all different languages out there. The core is kept shared and we expose a native, familiar interface per language. The goal is that the consumer of a language specifc package does not need to care or see that there's a different engine under the hood, as far as they know, it's all native. We can compile for different platforms as well so there's no need for any additional libraries to use this.
The project is created this way:
- itsme-golang -> dependency of the clang
itsme.go
file itsme.go
exposes itsme-golang functionality by creating C style functions using cgoitsme.go
is built as a shared library for Unix (itsme_lib.so
) and Windows (itsme_lib.dll
)- The created shared libraries are used in the language specific projects where the C library is exposed using a native bridge which is specific per language
As each binding package is created in the language it is used for, the specific details per package can be found in those folder's README.md
. Scripts to run this on Windows (using PowerShell) and Unix (using plain bash scripts) are available in the project repositories. Be advised that for the packages to be created, you need to be able to build the C library for both Windows and Unix. A CI system will be made available to facilitate this going forward.
To make sure you are compatible with the underlying structure, the bindings need to expose objects which can be marchalled into json which can then in turn be marchalled back to objects by the Golang C bridge. This is done to keep the interface as simple and as performant as possible.
The objects needed are the ones used in the exposed function code in our Go library:
type ItsmeSettings struct {
ClientID string `json:"client_id"`
RedirectURI string `json:"redirect_uri"`
SigningCertificateID string `json:"signing_certificate_id"`
SigningCert string `json:"signing_cert"`
EncryptionCert string `json:"encryption_cert"`
}
//URLConfiguration defines the config needed to construct the OIDC url
type URLConfiguration struct {
Scopes []string `json:"scopes"`
ServiceCode string `json:"service_code"`
RequestURI string `json:"request_uri"`
}
Have a look at one of the current bindings to see how this works.
- Jan De Dobbeleer (Initial work)
- Roeland Matthijssens