Skip to content

Latest commit

 

History

History
58 lines (41 loc) · 2.35 KB

File metadata and controls

58 lines (41 loc) · 2.35 KB

Indexing.Authentication

Overview

Available Operations

RotateToken

Rotates the secret value inside the Indexing API token and returns the new raw secret. All other properties of the token are unchanged. In order to rotate the secret value, include the token as the bearer token in the /rotatetoken request. Please refer to Token rotation documentation for more information.

Example Usage

package main

import(
	"context"
	"os"
	apiclientgo "github.com/gleanwork/api-client-go"
	"log"
)

func main() {
    ctx := context.Background()

    s := apiclientgo.New(
        apiclientgo.WithSecurity(os.Getenv("GLEAN_API_TOKEN")),
    )

    res, err := s.Indexing.Authentication.RotateToken(ctx)
    if err != nil {
        log.Fatal(err)
    }
    if res.RotateTokenResponse != nil {
        // handle response
    }
}

Parameters

Parameter Type Required Description
ctx context.Context ✔️ The context to use for the request.
opts []operations.Option The options for this request.

Response

*operations.PostAPIIndexV1RotatetokenResponse, error

Errors

Error Type Status Code Content Type
apierrors.APIError 4XX, 5XX */*