Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

babymum7/kratos-client-go

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 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: latest
  • 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/babymum7/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 identified 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

Class Method HTTP request Description
MetadataApi GetVersion Get /version Return Running Software Version.
MetadataApi IsAlive Get /health/alive Check HTTP Server Status
MetadataApi IsReady Get /health/ready Check HTTP Server and Database Status
V0alpha2Api AdminCreateIdentity Post /identities Create an Identity
V0alpha2Api AdminCreateSelfServiceRecoveryLink Post /recovery/link Create a Recovery Link
V0alpha2Api AdminDeleteIdentity Delete /identities/{id} Delete an Identity
V0alpha2Api AdminDeleteIdentitySessions Delete /identities/{id}/sessions Calling this endpoint irrecoverably and permanently deletes and invalidates all sessions that belong to the given Identity.
V0alpha2Api AdminGetIdentity Get /identities/{id} Get an Identity
V0alpha2Api AdminListIdentities Get /identities List Identities
V0alpha2Api AdminListIdentitySessions Get /identities/{id}/sessions This endpoint returns all sessions that belong to the given Identity.
V0alpha2Api AdminUpdateIdentity Put /identities/{id} Update an Identity
V0alpha2Api CreateSelfServiceLogoutFlowUrlForBrowsers Get /self-service/logout/browser Create a Logout URL for Browsers
V0alpha2Api GetJsonSchema Get /schemas/{id}
V0alpha2Api GetSelfServiceError Get /self-service/errors Get Self-Service Errors
V0alpha2Api GetSelfServiceLoginFlow Get /self-service/login/flows Get Login Flow
V0alpha2Api GetSelfServiceRecoveryFlow Get /self-service/recovery/flows Get Recovery Flow
V0alpha2Api GetSelfServiceRegistrationFlow Get /self-service/registration/flows Get Registration Flow
V0alpha2Api GetSelfServiceSettingsFlow Get /self-service/settings/flows Get Settings Flow
V0alpha2Api GetSelfServiceVerificationFlow Get /self-service/verification/flows Get Verification Flow
V0alpha2Api GetWebAuthnJavaScript Get /.well-known/ory/webauthn.js Get WebAuthn JavaScript
V0alpha2Api InitializeSelfServiceLoginFlowForBrowsers Get /self-service/login/browser Initialize Login Flow for Browsers
V0alpha2Api InitializeSelfServiceLoginFlowWithoutBrowser Get /self-service/login/api Initialize Login Flow for APIs, Services, Apps, ...
V0alpha2Api InitializeSelfServiceRecoveryFlowForBrowsers Get /self-service/recovery/browser Initialize Recovery Flow for Browsers
V0alpha2Api InitializeSelfServiceRecoveryFlowWithoutBrowser Get /self-service/recovery/api Initialize Recovery Flow for APIs, Services, Apps, ...
V0alpha2Api InitializeSelfServiceRegistrationFlowForBrowsers Get /self-service/registration/browser Initialize Registration Flow for Browsers
V0alpha2Api InitializeSelfServiceRegistrationFlowWithoutBrowser Get /self-service/registration/api Initialize Registration Flow for APIs, Services, Apps, ...
V0alpha2Api InitializeSelfServiceSettingsFlowForBrowsers Get /self-service/settings/browser Initialize Settings Flow for Browsers
V0alpha2Api InitializeSelfServiceSettingsFlowWithoutBrowser Get /self-service/settings/api Initialize Settings Flow for APIs, Services, Apps, ...
V0alpha2Api InitializeSelfServiceVerificationFlowForBrowsers Get /self-service/verification/browser Initialize Verification Flow for Browser Clients
V0alpha2Api InitializeSelfServiceVerificationFlowWithoutBrowser Get /self-service/verification/api Initialize Verification Flow for APIs, Services, Apps, ...
V0alpha2Api ListIdentitySchemas Get /schemas
V0alpha2Api ListSessions Get /sessions This endpoints returns all other active sessions that belong to the logged-in user. The current session can be retrieved by calling the `/sessions/whoami` endpoint.
V0alpha2Api RevokeSession Delete /sessions/{id} Calling this endpoint invalidates the specified session. The current session cannot be revoked. Session data are not deleted.
V0alpha2Api RevokeSessions Delete /sessions Calling this endpoint invalidates all except the current session that belong to the logged-in user. Session data are not deleted.
V0alpha2Api SubmitSelfServiceLoginFlow Post /self-service/login Submit a Login Flow
V0alpha2Api SubmitSelfServiceLogoutFlow Get /self-service/logout Complete Self-Service Logout
V0alpha2Api SubmitSelfServiceLogoutFlowWithoutBrowser Delete /self-service/logout/api Perform Logout for APIs, Services, Apps, ...
V0alpha2Api SubmitSelfServiceRecoveryFlow Post /self-service/recovery Complete Recovery Flow
V0alpha2Api SubmitSelfServiceRegistrationFlow Post /self-service/registration Submit a Registration Flow
V0alpha2Api SubmitSelfServiceSettingsFlow Post /self-service/settings Complete Settings Flow
V0alpha2Api SubmitSelfServiceVerificationFlow Post /self-service/verification Complete Verification Flow
V0alpha2Api ToSession Get /sessions/whoami Check Who the Current HTTP Session Belongs To

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]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Shell 100.0%