sdk

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 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"),
 )

 // You now have access to the various API endpoints of hydra, for example the oauth2 client endpoint:
 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)

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 offers OAuth2 Client management capabilities.
	Client *client.HTTPManager

	// SSO offers Social Login management capabilities.
	SSO *connection.HTTPManager

	// JWK offers JSON Web Key management capabilities.
	JWK *jwk.HTTPManager

	// Policies offers Access Policy management capabilities.
	Policies *policy.HTTPManager

	// Warden offers Access Token and Access Request validation strategies.
	Warden *warden.HTTPWarden
	// contains filtered or unexported fields
}

Client offers easy use of all HTTP clients.

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