sdk

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 9, 2016 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Overview

Package SDK offers convenience functions for Go code around Hydra's HTTP APIs.

 import "github.com/ory-am/hydra/sdk"
 import "github.com/ory-am/hydra/client"
 var hydra, err = sdk.Connect(
	sdk.ClientID("client-id"),
	sdk.ClientSecret("client-secret"),
 	sdk.ClustURL("https://localhost:4444"),
 )

 // Create a new OAuth2 client
 var newClient, err = hydra.Client.CreateClient(&client.Client{
 	ID:                "deadbeef",
 	Secret:            "sup3rs3cret",
 	RedirectURIs:      []string{"http://yourapp/callback"},
 	// ...
 })

 // Retrieve newly created client
 var gotClient, err = hydra.Client.GetClient(newClient.ID)

 // Remove the newly created client
 var err = hydra.Client.DeleteClient(newClient.ID)

 // Retrieve list of all clients
 var clients, err = hydra.Client.GetClients()

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClientID

func ClientID(id string) option

ClientID sets OAuth client ID

func ClientSecret

func ClientSecret(secret string) option

ClientSecret sets OAuth client secret

func ClusterURL

func ClusterURL(urlStr string) option

ClusterURL sets Hydra service URL

func FromYAML

func FromYAML(file string) option

FromYAML loads configurations from a YAML file

func Scopes

func Scopes(scopes ...string) option

Scopes sets client scopes granted by Hydra

func SkipTLSVerify

func SkipTLSVerify() option

SkipTLSVerify skips TLS verification

Types

type Client

type Client struct {
	Client   *client.HTTPManager
	SSO      *connection.HTTPManager
	JWK      *jwk.HTTPManager
	Policies *policy.HTTPManager
	Warden   *warden.HTTPWarden
	// contains filtered or unexported fields
}

func Connect

func Connect(opts ...option) (*Client, error)

Connect instantiates a new client to communicate with Hydra

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL