package
1.3.1
Repository: https://github.com/ory/kratos.git
Documentation: pkg.go.dev

# README

Go API client for client

This is the API specification for Ory Identities with features such as registration, login, recovery, account verification, profile settings, password reset, identity management, session management, email and sms delivery, and more.

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:
  • 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/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 http://localhost

ClassMethodHTTP requestDescription
CourierAPIGetCourierMessageGet /admin/courier/messages/{id}Get a Message
CourierAPIListCourierMessagesGet /admin/courier/messagesList Messages
FrontendAPICreateBrowserLoginFlowGet /self-service/login/browserCreate Login Flow for Browsers
FrontendAPICreateBrowserLogoutFlowGet /self-service/logout/browserCreate a Logout URL for Browsers
FrontendAPICreateBrowserRecoveryFlowGet /self-service/recovery/browserCreate Recovery Flow for Browsers
FrontendAPICreateBrowserRegistrationFlowGet /self-service/registration/browserCreate Registration Flow for Browsers
FrontendAPICreateBrowserSettingsFlowGet /self-service/settings/browserCreate Settings Flow for Browsers
FrontendAPICreateBrowserVerificationFlowGet /self-service/verification/browserCreate Verification Flow for Browser Clients
FrontendAPICreateNativeLoginFlowGet /self-service/login/apiCreate Login Flow for Native Apps
FrontendAPICreateNativeRecoveryFlowGet /self-service/recovery/apiCreate Recovery Flow for Native Apps
FrontendAPICreateNativeRegistrationFlowGet /self-service/registration/apiCreate Registration Flow for Native Apps
FrontendAPICreateNativeSettingsFlowGet /self-service/settings/apiCreate Settings Flow for Native Apps
FrontendAPICreateNativeVerificationFlowGet /self-service/verification/apiCreate Verification Flow for Native Apps
FrontendAPIDisableMyOtherSessionsDelete /sessionsDisable my other sessions
FrontendAPIDisableMySessionDelete /sessions/{id}Disable one of my sessions
FrontendAPIExchangeSessionTokenGet /sessions/token-exchangeExchange Session Token
FrontendAPIGetFlowErrorGet /self-service/errorsGet User-Flow Errors
FrontendAPIGetLoginFlowGet /self-service/login/flowsGet Login Flow
FrontendAPIGetRecoveryFlowGet /self-service/recovery/flowsGet Recovery Flow
FrontendAPIGetRegistrationFlowGet /self-service/registration/flowsGet Registration Flow
FrontendAPIGetSettingsFlowGet /self-service/settings/flowsGet Settings Flow
FrontendAPIGetVerificationFlowGet /self-service/verification/flowsGet Verification Flow
FrontendAPIGetWebAuthnJavaScriptGet /.well-known/ory/webauthn.jsGet WebAuthn JavaScript
FrontendAPIListMySessionsGet /sessionsGet My Active Sessions
FrontendAPIPerformNativeLogoutDelete /self-service/logout/apiPerform Logout for Native Apps
FrontendAPIToSessionGet /sessions/whoamiCheck Who the Current HTTP Session Belongs To
FrontendAPIUpdateLoginFlowPost /self-service/loginSubmit a Login Flow
FrontendAPIUpdateLogoutFlowGet /self-service/logoutUpdate Logout Flow
FrontendAPIUpdateRecoveryFlowPost /self-service/recoveryUpdate Recovery Flow
FrontendAPIUpdateRegistrationFlowPost /self-service/registrationUpdate Registration Flow
FrontendAPIUpdateSettingsFlowPost /self-service/settingsComplete Settings Flow
FrontendAPIUpdateVerificationFlowPost /self-service/verificationComplete Verification Flow
IdentityAPIBatchPatchIdentitiesPatch /admin/identitiesCreate multiple identities
IdentityAPICreateIdentityPost /admin/identitiesCreate an Identity
IdentityAPICreateRecoveryCodeForIdentityPost /admin/recovery/codeCreate a Recovery Code
IdentityAPICreateRecoveryLinkForIdentityPost /admin/recovery/linkCreate a Recovery Link
IdentityAPIDeleteIdentityDelete /admin/identities/{id}Delete an Identity
IdentityAPIDeleteIdentityCredentialsDelete /admin/identities/{id}/credentials/{type}Delete a credential for a specific identity
IdentityAPIDeleteIdentitySessionsDelete /admin/identities/{id}/sessionsDelete & Invalidate an Identity's Sessions
IdentityAPIDisableSessionDelete /admin/sessions/{id}Deactivate a Session
IdentityAPIExtendSessionPatch /admin/sessions/{id}/extendExtend a Session
IdentityAPIGetIdentityGet /admin/identities/{id}Get an Identity
IdentityAPIGetIdentitySchemaGet /schemas/{id}Get Identity JSON Schema
IdentityAPIGetSessionGet /admin/sessions/{id}Get Session
IdentityAPIListIdentitiesGet /admin/identitiesList Identities
IdentityAPIListIdentitySchemasGet /schemasGet all Identity Schemas
IdentityAPIListIdentitySessionsGet /admin/identities/{id}/sessionsList an Identity's Sessions
IdentityAPIListSessionsGet /admin/sessionsList All Sessions
IdentityAPIPatchIdentityPatch /admin/identities/{id}Patch an Identity
IdentityAPIUpdateIdentityPut /admin/identities/{id}Update an Identity
MetadataAPIGetVersionGet /versionReturn Running Software Version.
MetadataAPIIsAliveGet /health/aliveCheck HTTP Server Status
MetadataAPIIsReadyGet /health/readyCheck HTTP Server and Database Status

Documentation For Models

Documentation For Authorization

oryAccessToken

  • Type: API key
  • API key parameter name: Authorization
  • Location: HTTP header

Note, each API key must be added to a map of map[string]APIKey where the key is: Authorization 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

[email protected]