Skip to content

Windfarer/orykratos-client-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Go API client for client

Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the administative API port you should use something like Nginx, Ory Oathkeeper, or any other technology capable of authorizing incoming requests.

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: v0.6.0-alpha.16
  • Package version: 1.0.0
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import client "github.com/ory/kratos-client-go"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), client.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), client.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identifield by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), client.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), client.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://demo.tenants.oryapis.com/api/kratos/public

Class Method HTTP request Description
AdminApi CreateIdentity Post /identities Create an Identity
AdminApi CreateRecoveryLink Post /recovery/link Create a Recovery Link
AdminApi DeleteIdentity Delete /identities/{id} Delete an Identity
AdminApi GetIdentity Get /identities/{id} Get an Identity
AdminApi GetSchema Get /schemas/{id}
AdminApi GetSelfServiceError Get /self-service/errors Get User-Facing Self-Service Errors
AdminApi GetSelfServiceLoginFlow Get /self-service/login/flows Get Login Flow
AdminApi GetSelfServiceRecoveryFlow Get /self-service/recovery/flows Get information about a recovery flow
AdminApi GetSelfServiceRegistrationFlow Get /self-service/registration/flows Get Registration Flow
AdminApi GetSelfServiceSettingsFlow Get /self-service/settings/flows Get Settings Flow
AdminApi GetSelfServiceVerificationFlow Get /self-service/verification/flows Get Verification Flow
AdminApi GetVersion Get /version Return Running Software Version.
AdminApi IsAlive Get /health/alive Check HTTP Server Status
AdminApi IsReady Get /health/ready Check HTTP Server and Database Status
AdminApi ListIdentities Get /identities List Identities
AdminApi Prometheus Get /metrics/prometheus Get snapshot metrics from the Hydra service. If you're using k8s, you can then add annotations to your deployment like so:
AdminApi UpdateIdentity Put /identities/{id} Update an Identity
PublicApi GetSchema Get /schemas/{id}
PublicApi GetSelfServiceError Get /self-service/errors Get User-Facing Self-Service Errors
PublicApi GetSelfServiceLoginFlow Get /self-service/login/flows Get Login Flow
PublicApi GetSelfServiceRecoveryFlow Get /self-service/recovery/flows Get information about a recovery flow
PublicApi GetSelfServiceRegistrationFlow Get /self-service/registration/flows Get Registration Flow
PublicApi GetSelfServiceSettingsFlow Get /self-service/settings/flows Get Settings Flow
PublicApi GetSelfServiceVerificationFlow Get /self-service/verification/flows Get Verification Flow
PublicApi InitializeSelfServiceBrowserLogoutFlow Get /self-service/browser/flows/logout Initialize Browser-Based Logout User Flow
PublicApi InitializeSelfServiceLoginViaAPIFlow Get /self-service/login/api Initialize Login Flow for API clients
PublicApi InitializeSelfServiceLoginViaBrowserFlow Get /self-service/login/browser Initialize Login Flow for browsers
PublicApi InitializeSelfServiceRecoveryViaAPIFlow Get /self-service/recovery/api Initialize Recovery Flow for API Clients
PublicApi InitializeSelfServiceRecoveryViaBrowserFlow Get /self-service/recovery/browser Initialize Recovery Flow for Browser Clients
PublicApi InitializeSelfServiceRegistrationViaAPIFlow Get /self-service/registration/api Initialize Registration Flow for API clients
PublicApi InitializeSelfServiceRegistrationViaBrowserFlow Get /self-service/registration/browser Initialize Registration Flow for browsers
PublicApi InitializeSelfServiceSettingsViaAPIFlow Get /self-service/settings/api Initialize Settings Flow for API Clients
PublicApi InitializeSelfServiceSettingsViaBrowserFlow Get /self-service/settings/browser Initialize Settings Flow for Browsers
PublicApi InitializeSelfServiceVerificationViaAPIFlow Get /self-service/verification/api Initialize Verification Flow for API Clients
PublicApi InitializeSelfServiceVerificationViaBrowserFlow Get /self-service/verification/browser Initialize Verification Flow for Browser Clients
PublicApi RevokeSession Delete /sessions Initialize Logout Flow for API Clients - Revoke a Session
PublicApi SubmitSelfServiceLoginFlow Post /self-service/login Submit a Login Flow
PublicApi SubmitSelfServiceRecoveryFlow Post /self-service/recovery Complete Recovery Flow
PublicApi SubmitSelfServiceRecoveryFlowWithLinkMethod Post /self-service/recovery/methods/link Complete Recovery Flow with Link Method
PublicApi SubmitSelfServiceRegistrationFlow Post /self-service/registration Submit a Registration Flow
PublicApi SubmitSelfServiceSettingsFlow Post /self-service/settings Complete Settings Flow
PublicApi SubmitSelfServiceVerificationFlow Post /self-service/verification/methods/link Complete Verification Flow
PublicApi Whoami Get /sessions/whoami Check Who the Current HTTP Session Belongs To

Documentation For Models

Documentation For Authorization

sessionCookie

  • Type: API key
  • API key parameter name: ory_kratos_session
  • Location:

Note, each API key must be added to a map of map[string]APIKey where the key is: ory_kratos_session and passed in as the auth context for each request.

sessionToken

  • Type: API key
  • API key parameter name: X-Session-Token
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: X-Session-Token and passed in as the auth context for each request.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

hi@ory.sh

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Shell 100.0%