diff --git a/go/internal/openapi/api_authentication.go b/go/internal/openapi/api_authentication.go index 624eaa859..7a8732014 100644 --- a/go/internal/openapi/api_authentication.go +++ b/go/internal/openapi/api_authentication.go @@ -1026,6 +1026,201 @@ func (a *AuthenticationAPIService) V1AuthenticationExpireAllExecute(r ApiV1Authe return localVarHTTPResponse, nil } +type ApiV1AuthenticationGetPollerTokenRequest struct { + ctx context.Context + ApiService *AuthenticationAPIService + appId string + endpointId string +} + +func (r ApiV1AuthenticationGetPollerTokenRequest) Execute() (*AuthTokenOut, *http.Response, error) { + return r.ApiService.V1AuthenticationGetPollerTokenExecute(r) +} + +/* +V1AuthenticationGetPollerToken Get Poller Token + +Get the current auth token for the poller. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1AuthenticationGetPollerTokenRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationGetPollerToken(ctx context.Context, appId string, endpointId string) ApiV1AuthenticationGetPollerTokenRequest { + return ApiV1AuthenticationGetPollerTokenRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +// Execute executes the request +// @return AuthTokenOut +func (a *AuthenticationAPIService) V1AuthenticationGetPollerTokenExecute(r ApiV1AuthenticationGetPollerTokenRequest) (*AuthTokenOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthTokenOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationGetPollerToken") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.appId) < 1 { + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} + type ApiV1AuthenticationLogoutRequest struct { ctx context.Context ApiService *AuthenticationAPIService @@ -1201,3 +1396,219 @@ func (a *AuthenticationAPIService) V1AuthenticationLogoutExecute(r ApiV1Authenti return localVarHTTPResponse, nil } + +type ApiV1AuthenticationRotatePollerTokenRequest struct { + ctx context.Context + ApiService *AuthenticationAPIService + appId string + endpointId string + rotatePollerTokenIn *RotatePollerTokenIn + idempotencyKey *string +} + +func (r ApiV1AuthenticationRotatePollerTokenRequest) RotatePollerTokenIn(rotatePollerTokenIn RotatePollerTokenIn) ApiV1AuthenticationRotatePollerTokenRequest { + r.rotatePollerTokenIn = &rotatePollerTokenIn + return r +} + +// The request's idempotency key +func (r ApiV1AuthenticationRotatePollerTokenRequest) IdempotencyKey(idempotencyKey string) ApiV1AuthenticationRotatePollerTokenRequest { + r.idempotencyKey = &idempotencyKey + return r +} + +func (r ApiV1AuthenticationRotatePollerTokenRequest) Execute() (*AuthTokenOut, *http.Response, error) { + return r.ApiService.V1AuthenticationRotatePollerTokenExecute(r) +} + +/* +V1AuthenticationRotatePollerToken Rotate Poller Token + +Create a new auth token that can for the poller API. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param appId The app's ID or UID + @param endpointId The ep's ID or UID + @return ApiV1AuthenticationRotatePollerTokenRequest +*/ +func (a *AuthenticationAPIService) V1AuthenticationRotatePollerToken(ctx context.Context, appId string, endpointId string) ApiV1AuthenticationRotatePollerTokenRequest { + return ApiV1AuthenticationRotatePollerTokenRequest{ + ApiService: a, + ctx: ctx, + appId: appId, + endpointId: endpointId, + } +} + +// Execute executes the request +// @return AuthTokenOut +func (a *AuthenticationAPIService) V1AuthenticationRotatePollerTokenExecute(r ApiV1AuthenticationRotatePollerTokenRequest) (*AuthTokenOut, *http.Response, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthTokenOut + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "AuthenticationAPIService.V1AuthenticationRotatePollerToken") + if err != nil { + return localVarReturnValue, nil, &GenericOpenAPIError{error: err.Error()} + } + + localVarPath := localBasePath + "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate" + localVarPath = strings.Replace(localVarPath, "{"+"app_id"+"}", url.PathEscape(parameterValueToString(r.appId, "appId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"endpoint_id"+"}", url.PathEscape(parameterValueToString(r.endpointId, "endpointId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.appId) < 1 { + return localVarReturnValue, nil, reportError("appId must have at least 1 elements") + } + if strlen(r.appId) > 256 { + return localVarReturnValue, nil, reportError("appId must have less than 256 elements") + } + if strlen(r.endpointId) < 1 { + return localVarReturnValue, nil, reportError("endpointId must have at least 1 elements") + } + if strlen(r.endpointId) > 256 { + return localVarReturnValue, nil, reportError("endpointId must have less than 256 elements") + } + if r.rotatePollerTokenIn == nil { + return localVarReturnValue, nil, reportError("rotatePollerTokenIn is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + if r.idempotencyKey != nil { + parameterAddToHeaderOrQuery(localVarHeaderParams, "idempotency-key", r.idempotencyKey, "simple", "") + } + // body params + localVarPostBody = r.rotatePollerTokenIn + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, nil, err + } + + localVarHTTPResponse, err := a.client.callAPI(req) + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, localVarHTTPResponse, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 403 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 422 { + var v HTTPValidationError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + return localVarReturnValue, localVarHTTPResponse, newErr + } + if localVarHTTPResponse.StatusCode == 429 { + var v HttpErrorOut + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.error = err.Error() + return localVarReturnValue, localVarHTTPResponse, newErr + } + newErr.error = formatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.model = v + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &GenericOpenAPIError{ + body: localVarBody, + error: err.Error(), + } + return localVarReturnValue, localVarHTTPResponse, newErr + } + + return localVarReturnValue, localVarHTTPResponse, nil +} diff --git a/go/internal/openapi/api_message.go b/go/internal/openapi/api_message.go index 392c6e24e..5bed504fe 100644 --- a/go/internal/openapi/api_message.go +++ b/go/internal/openapi/api_message.go @@ -1454,8 +1454,9 @@ func (r ApiV1MessageExpungeContentRequest) Execute() (*http.Response, error) { /* V1MessageExpungeContent Delete message payload -Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content. +Delete the given message's payload. +Useful in cases when a message was accidentally sent with sensitive content. The message can't be replayed or resent once its payload has been deleted or expired. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/go/internal/openapi/api_message_attempt.go b/go/internal/openapi/api_message_attempt.go index 0a5adb8a4..dc2cea45c 100644 --- a/go/internal/openapi/api_message_attempt.go +++ b/go/internal/openapi/api_message_attempt.go @@ -313,7 +313,10 @@ func (r ApiV1MessageAttemptExpungeContentRequest) Execute() (*http.Response, err /* V1MessageAttemptExpungeContent Delete attempt response body -Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content. +Deletes the given attempt's response body. + +Useful when an endpoint accidentally returned sensitive content. +The message can't be replayed or resent once its payload has been deleted or expired. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param appId The app's ID or UID @@ -912,7 +915,9 @@ func (r ApiV1MessageAttemptListAttemptedDestinationsRequest) Execute() (*ListRes /* V1MessageAttemptListAttemptedDestinations List Attempted Destinations -List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt. +List endpoints attempted by a given message. + +Additionally includes metadata about the latest message attempt. By default, endpoints are listed in ascending order by ID. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). diff --git a/openapi.json b/openapi.json index 00ea46891..b1be13f33 100644 --- a/openapi.json +++ b/openapi.json @@ -17086,7 +17086,7 @@ }, "/api/v1/app/{app_id}/msg/{msg_id}/attempt/{attempt_id}/content": { "delete": { - "description": "Deletes the given attempt's response body. Useful when an endpoint accidentally returned sensitive content.", + "description": "Deletes the given attempt's response body.\n\nUseful when an endpoint accidentally returned sensitive content.\nThe message can't be replayed or resent once its payload has been deleted or expired.", "operationId": "v1.message-attempt.expunge-content", "parameters": [ { @@ -17485,7 +17485,7 @@ }, "/api/v1/app/{app_id}/msg/{msg_id}/content": { "delete": { - "description": "Delete the given message's payload. Useful in cases when a message was accidentally sent with sensitive content.\n\nThe message can't be replayed or resent once its payload has been deleted or expired.", + "description": "Delete the given message's payload.\n\nUseful in cases when a message was accidentally sent with sensitive content.\nThe message can't be replayed or resent once its payload has been deleted or expired.", "operationId": "v1.message.expunge-content", "parameters": [ { @@ -17669,7 +17669,7 @@ }, "/api/v1/app/{app_id}/msg/{msg_id}/endpoint": { "get": { - "description": "List endpoints attempted by a given message. Additionally includes metadata about the latest message attempt.\nBy default, endpoints are listed in ascending order by ID.", + "description": "List endpoints attempted by a given message.\n\nAdditionally includes metadata about the latest message attempt.\nBy default, endpoints are listed in ascending order by ID.", "operationId": "v1.message-attempt.list-attempted-destinations", "parameters": [ { @@ -20169,6 +20169,407 @@ ] } }, + "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token": { + "get": { + "description": "Get the current auth token for the poller.", + "operationId": "v1.authentication.get-poller-token", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + } + ], + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthTokenOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Get Poller Token", + "tags": [ + "Authentication" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const authTokenOut = await svix.authentication.getPollerToken(\"app_id\", \"endpoint_id\");" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const authTokenOut = await svix.authentication.getPollerToken(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Python", + "lang": "Python", + "source": "auth_token_out = svix.authentication.get_poller_token(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "auth_token_out = await svix.authentication.get_poller_token(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Go", + "lang": "Go", + "source": "authTokenOut, err := svixClient.Authentication.GetPollerToken(ctx, \"app_id\", \"endpoint_id\")" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val authTokenOut = svix.authentication.getPollerToken(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Java", + "lang": "Java", + "source": "AuthTokenOut authTokenOut = svix.getAuthentication().getPollerToken(\"app_id\", \"endpoint_id\");" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "auth_token_out = svix.authentication.get_poller_token(\"app_id\", \"endpoint_id\")" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let auth_token_out = svix.authentication().get_poller_token(\"app_id\", \"endpoint_id\").await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var authTokenOut = await svix.Authentication.GetPollerTokenAsync(\"app_id\", \"endpoint_id\");" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication get-poller-token \"app_id\" \"endpoint_id\"" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'GET' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n" + } + ] + } + }, + "/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate": { + "post": { + "description": "Create a new auth token that can for the poller API.", + "operationId": "v1.authentication.rotate-poller-token", + "parameters": [ + { + "description": "The app's ID or UID", + "in": "path", + "name": "app_id", + "required": true, + "schema": { + "description": "The app's ID or UID", + "example": "unique-app-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The ep's ID or UID", + "in": "path", + "name": "endpoint_id", + "required": true, + "schema": { + "description": "The ep's ID or UID", + "example": "unique-ep-identifier", + "maxLength": 256, + "minLength": 1, + "pattern": "^[a-zA-Z0-9\\-_.]+$", + "type": "string" + }, + "style": "simple" + }, + { + "description": "The request's idempotency key", + "in": "header", + "name": "idempotency-key", + "schema": { + "type": "string" + }, + "style": "simple" + } + ], + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/RotatePollerTokenIn" + } + } + }, + "required": true + }, + "responses": { + "201": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/AuthTokenOut" + } + } + }, + "description": "" + }, + "400": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Bad request" + }, + "401": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Unauthorized" + }, + "403": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Forbidden" + }, + "404": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Not Found" + }, + "409": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Conflict" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + }, + "429": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HttpErrorOut" + } + } + }, + "description": "Too Many Requests" + } + }, + "security": [ + { + "HTTPBearer": [] + } + ], + "summary": "Rotate Poller Token", + "tags": [ + "Authentication" + ], + "x-codeSamples": [ + { + "label": "JavaScript", + "lang": "JavaScript", + "source": "const authTokenOut = await svix.authentication.rotatePollerToken(\"app_id\", \"endpoint_id\", {\n expiry: null\n});" + }, + { + "label": "TypeScript", + "lang": "JavaScript", + "source": "const authTokenOut = await svix.authentication.rotatePollerToken(\"app_id\", \"endpoint_id\", {\n expiry: null\n});" + }, + { + "label": "Python", + "lang": "Python", + "source": "auth_token_out = svix.authentication.rotate_poller_token(\"app_id\", \"endpoint_id\", RotatePollerTokenIn(\n expiry=None\n), options=...)" + }, + { + "label": "Python (Async)", + "lang": "Python", + "source": "auth_token_out = await svix.authentication.rotate_poller_token(\"app_id\", \"endpoint_id\", RotatePollerTokenIn(\n expiry=None\n), options=...)" + }, + { + "label": "Go", + "lang": "Go", + "source": "authTokenOut, err := svixClient.Authentication.RotatePollerToken(ctx, \"app_id\", \"endpoint_id\", &RotatePollerTokenIn{\n Expiry: nil,\n})" + }, + { + "label": "Kotlin", + "lang": "Kotlin", + "source": "val authTokenOut = svix.authentication.rotatePollerToken(\"app_id\", \"endpoint_id\", RotatePollerTokenIn()\n .expiry(null)\n)" + }, + { + "label": "Java", + "lang": "Java", + "source": "AuthTokenOut authTokenOut = svix.getAuthentication().rotatePollerToken(\"app_id\", \"endpoint_id\", new RotatePollerTokenIn()\n .expiry(null)\n);" + }, + { + "label": "Ruby", + "lang": "Ruby", + "source": "auth_token_out = svix.authentication.rotate_poller_token(\"app_id\", \"endpoint_id\", Svix::RotatePollerTokenIn.new({\n \"expiry\": nil\n}))" + }, + { + "label": "Rust", + "lang": "Rust", + "source": "let auth_token_out = svix.authentication().rotate_poller_token(\"app_id\", \"endpoint_id\", RotatePollerTokenIn {\n expiry: None,\n}, None).await?;" + }, + { + "label": "C#", + "lang": "C#", + "source": "var authTokenOut = await svix.Authentication.RotatePollerTokenAsync(\"app_id\", \"endpoint_id\", new RotatePollerTokenIn{\n expiry: null\n});" + }, + { + "label": "CLI", + "lang": "Shell", + "source": "svix authentication rotate-poller-token \"app_id\" \"endpoint_id\" '{\n \"expiry\": null\n}'" + }, + { + "label": "cURL", + "lang": "Shell", + "source": "curl -X 'POST' \\\n 'https://api.eu.svix.com/api/v1/auth/app/{app_id}/poller/{endpoint_id}/token/rotate' \\\n -H 'Authorization: Bearer AUTH_TOKEN' \\\n -H 'Accept: application/json' \\\n -H 'Content-Type: application/json'\n \\\n -d '{\n \"expiry\": null\n }'" + } + ] + } + }, "/api/v1/auth/dashboard-access/{app_id}": { "post": { "deprecated": true,