Skip to content

Latest commit

 

History

History
518 lines (327 loc) · 12.3 KB

File metadata and controls

518 lines (327 loc) · 12.3 KB

\AuthenticationAPI

All URIs are relative to http://localhost:3000/api

Method HTTP request Description
AuthLoginGet Get /auth/login Fetches login metadata
AuthLoginPost Post /auth/login Performs Login
AuthLogoutPost Post /auth/logout Destroys current session
AuthOidcProviderIdLoginGet Get /auth/oidc/{provider_id}/login Begin OIDC authentication flow and redirect to OIDC provider
AuthOidcProviderIdRedirectGet Get /auth/oidc/{provider_id}/redirect Finish OIDC authentication flow, upon succes you will be logged in
UserTokensApiTokenIdDelete Delete /user/tokens/{api_token_id} Expires API token
UserTokensGet Get /user/tokens Fetch API tokens for user
UserTokensPost Post /user/tokens Create an API token

AuthLoginGet

LoginMetadata AuthLoginGet(ctx).Execute()

Fetches login metadata

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthenticationAPI.AuthLoginGet(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.AuthLoginGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `AuthLoginGet`: LoginMetadata
	fmt.Fprintf(os.Stdout, "Response from `AuthenticationAPI.AuthLoginGet`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiAuthLoginGetRequest struct via the builder pattern

Return type

LoginMetadata

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AuthLoginPost

AuthLoginPost(ctx).LoginBody(loginBody).Execute()

Performs Login

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {
	loginBody := *openapiclient.NewLogin() // Login | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AuthenticationAPI.AuthLoginPost(context.Background()).LoginBody(loginBody).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.AuthLoginPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Other Parameters

Other parameters are passed through a pointer to a apiAuthLoginPostRequest struct via the builder pattern

Name Type Description Notes
loginBody Login

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AuthLogoutPost

AuthLogoutPost(ctx).Execute()

Destroys current session

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AuthenticationAPI.AuthLogoutPost(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.AuthLogoutPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiAuthLogoutPostRequest struct via the builder pattern

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AuthOidcProviderIdLoginGet

AuthOidcProviderIdLoginGet(ctx, providerId).Execute()

Begin OIDC authentication flow and redirect to OIDC provider

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {
	providerId := "mysso" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AuthenticationAPI.AuthOidcProviderIdLoginGet(context.Background(), providerId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.AuthOidcProviderIdLoginGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
providerId string

Other Parameters

Other parameters are passed through a pointer to a apiAuthOidcProviderIdLoginGetRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AuthOidcProviderIdRedirectGet

AuthOidcProviderIdRedirectGet(ctx, providerId).Execute()

Finish OIDC authentication flow, upon succes you will be logged in

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {
	providerId := "mysso" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AuthenticationAPI.AuthOidcProviderIdRedirectGet(context.Background(), providerId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.AuthOidcProviderIdRedirectGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
providerId string

Other Parameters

Other parameters are passed through a pointer to a apiAuthOidcProviderIdRedirectGetRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserTokensApiTokenIdDelete

UserTokensApiTokenIdDelete(ctx, apiTokenId).Execute()

Expires API token

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {
	apiTokenId := "kwofd61g93-yuqvex8efmhjkgnbxlo8mp1tin6spyhu=" // string | 

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	r, err := apiClient.AuthenticationAPI.UserTokensApiTokenIdDelete(context.Background(), apiTokenId).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.UserTokensApiTokenIdDelete``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
apiTokenId string

Other Parameters

Other parameters are passed through a pointer to a apiUserTokensApiTokenIdDeleteRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserTokensGet

[]APIToken UserTokensGet(ctx).Execute()

Fetch API tokens for user

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthenticationAPI.UserTokensGet(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.UserTokensGet``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UserTokensGet`: []APIToken
	fmt.Fprintf(os.Stdout, "Response from `AuthenticationAPI.UserTokensGet`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiUserTokensGetRequest struct via the builder pattern

Return type

[]APIToken

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UserTokensPost

APIToken UserTokensPost(ctx).Execute()

Create an API token

Example

package main

import (
	"context"
	"fmt"
	"os"
	openapiclient "github.com/client-api/semaphore-go"
)

func main() {

	configuration := openapiclient.NewConfiguration()
	apiClient := openapiclient.NewAPIClient(configuration)
	resp, r, err := apiClient.AuthenticationAPI.UserTokensPost(context.Background()).Execute()
	if err != nil {
		fmt.Fprintf(os.Stderr, "Error when calling `AuthenticationAPI.UserTokensPost``: %v\n", err)
		fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
	}
	// response from `UserTokensPost`: APIToken
	fmt.Fprintf(os.Stdout, "Response from `AuthenticationAPI.UserTokensPost`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiUserTokensPostRequest struct via the builder pattern

Return type

APIToken

Authorization

cookie, bearer

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json, text/plain; charset=utf-8

[Back to top] [Back to API list] [Back to Model list] [Back to README]