# README
Topicus KeyHub SDK for Go
Note: The version number of the SDK must match the version of your Topicus KeyHub installation. An older version of the SDK might work on a newer version of Topicus KeyHub via the provided backwards compatibility layer, but a newer version of the SDK will not work on an older version of Topicus KeyHub.
Note: The GO SDK is current considered in alpha status. Its API might change in future versions, it is largely untested and at the moment only supports the client credentials grant.
1. Installation
go get github.com/topicuskeyhub/sdk-go
2. Getting started
2.1 Create a client application in Topicus KeyHub
Register a OAuth 2.0 client application in Topicus KeyHub as described in section 16.1 of the manual. Section 16.5 describes the permissions you can assign to this application.
2.2 Create a KeyHubClient object and make an API call
package main
import (
"context"
"log"
"net/http"
keyhub "github.com/topicuskeyhub/sdk-go"
)
func main() {
issuer := "<the issuer of your Topicus KeyHub installation>"
clientid := "<the client id of your application registration>"
clientsecret := "<the client sercret of your application registration>"
adapter, err := keyhub.NewKeyHubRequestAdapter(http.DefaultClient, issuer, clientid, clientsecret)
if err != nil {
log.Fatalf("Cannot create request adapter: %v\n", err)
}
client := keyhub.NewKeyHubClient(adapter)
me, err := client.Client().Me().Get(context.Background(), nil)
if err != nil {
log.Fatalf("Error getting /client/me: %v\n", err)
}
log.Printf("me: %s", *me.GetName())
}
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
No description provided by the author
copied from https://github.com/golang/oauth2/blob/master/deviceauth.go until https://github.com/golang/oauth2/issues/685 is fixed DeviceAuth returns a device auth struct which contains a device code and authorization information provided for users to enter on another device.
No description provided by the author
NewKeyHubClient instantiates a new KeyHubClient and sets the default values.
No description provided by the author
No description provided by the author
No description provided by the author
# Structs
No description provided by the author
KeyHubClient the main entry point of the SDK, exposes the configuration and the fluent API.