github.com/safedep/dry@v0.0.0-20241016050132-a15651f0548b/apiguard/tykgen/docs/OAuthApi.md (about)

     1  # {{classname}}
     2  
     3  All URIs are relative to *http://localhost/*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**AuthorizeClient**](OAuthApi.md#AuthorizeClient) | **Post** /tyk/oauth/authorize-client/ | Authorize client
     8  [**CreateOAuthClient**](OAuthApi.md#CreateOAuthClient) | **Post** /tyk/oauth/clients/create | Create new OAuth client
     9  [**DeleteOAuthClient**](OAuthApi.md#DeleteOAuthClient) | **Delete** /tyk/oauth/clients/{apiID}/{keyName} | Delete OAuth client
    10  [**GetOAuthClient**](OAuthApi.md#GetOAuthClient) | **Get** /tyk/oauth/clients/{apiID}/{keyName} | Get OAuth client
    11  [**GetOAuthClientTokens**](OAuthApi.md#GetOAuthClientTokens) | **Get** /tyk/oauth/clients/{apiID}/{keyName}/tokens | List tokens
    12  [**InvalidateOAuthRefresh**](OAuthApi.md#InvalidateOAuthRefresh) | **Delete** /tyk/oauth/refresh/{keyName} | Invalidate OAuth refresh token
    13  [**ListOAuthClients**](OAuthApi.md#ListOAuthClients) | **Get** /tyk/oauth/clients/{apiID} | List oAuth clients
    14  [**RevokeAllTokens**](OAuthApi.md#RevokeAllTokens) | **Post** /tyk/oauth/revoke_all | revoke all client's tokens
    15  [**RevokeSingleToken**](OAuthApi.md#RevokeSingleToken) | **Post** /tyk/oauth/revoke | revoke token
    16  [**UpdateoAuthClient**](OAuthApi.md#UpdateoAuthClient) | **Put** /tyk/oauth/clients/{apiID} | Update OAuth metadata and Policy ID
    17  
    18  # **AuthorizeClient**
    19  > interface{} AuthorizeClient(ctx, responseType, clientId, redirectUri, keyRules)
    20  Authorize client
    21  
    22  With the OAuth flow you will need to create authorisation or access tokens for your clients, in order to do this, Tyk provides a private API endpoint for your application to generate these codes and redirect the end-user back to the API Client.
    23  
    24  ### Required Parameters
    25  
    26  Name | Type | Description  | Notes
    27  ------------- | ------------- | ------------- | -------------
    28   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
    29    **responseType** | **string**|  | 
    30    **clientId** | **string**|  | 
    31    **redirectUri** | **string**|  | 
    32    **keyRules** | **string**|  | 
    33  
    34  ### Return type
    35  
    36  [**interface{}**](interface{}.md)
    37  
    38  ### Authorization
    39  
    40  [api_key](../README.md#api_key)
    41  
    42  ### HTTP request headers
    43  
    44   - **Content-Type**: application/x-www-form-urlencoded
    45   - **Accept**: application/json
    46  
    47  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
    48  
    49  # **CreateOAuthClient**
    50  > NewClientRequest CreateOAuthClient(ctx, optional)
    51  Create new OAuth client
    52  
    53  Any OAuth keys must be generated with the help of a client ID. These need to be pre-registered with Tyk before they can be used (in a similar vein to how you would register your app with Twitter before attempting to ask user permissions using their API). <br/><br/> <h3>Creating OAuth clients with Access to Multiple APIs</h3> New from Tyk Gateway 2.6.0 is the ability to create OAuth clients with access to more than one API. If you provide the api_id it works the same as in previous releases. If you don't provide the api_id the request uses policy access rights and enumerates APIs from their setting in the newly created OAuth-client.
    54  
    55  ### Required Parameters
    56  
    57  Name | Type | Description  | Notes
    58  ------------- | ------------- | ------------- | -------------
    59   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
    60   **optional** | ***OAuthApiCreateOAuthClientOpts** | optional parameters | nil if no parameters
    61  
    62  ### Optional Parameters
    63  Optional parameters are passed through a pointer to a OAuthApiCreateOAuthClientOpts struct
    64  Name | Type | Description  | Notes
    65  ------------- | ------------- | ------------- | -------------
    66   **body** | [**optional.Interface of NewClientRequest**](NewClientRequest.md)|  | 
    67  
    68  ### Return type
    69  
    70  [**NewClientRequest**](NewClientRequest.md)
    71  
    72  ### Authorization
    73  
    74  [api_key](../README.md#api_key)
    75  
    76  ### HTTP request headers
    77  
    78   - **Content-Type**: application/json
    79   - **Accept**: application/json
    80  
    81  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
    82  
    83  # **DeleteOAuthClient**
    84  > ApiModifyKeySuccess DeleteOAuthClient(ctx, apiID, keyName)
    85  Delete OAuth client
    86  
    87  Please note that tokens issued with the client ID will still be valid until they expire.
    88  
    89  ### Required Parameters
    90  
    91  Name | Type | Description  | Notes
    92  ------------- | ------------- | ------------- | -------------
    93   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
    94    **apiID** | **string**| The API ID | 
    95    **keyName** | **string**| The Client ID | 
    96  
    97  ### Return type
    98  
    99  [**ApiModifyKeySuccess**](apiModifyKeySuccess.md)
   100  
   101  ### Authorization
   102  
   103  [api_key](../README.md#api_key)
   104  
   105  ### HTTP request headers
   106  
   107   - **Content-Type**: Not defined
   108   - **Accept**: application/json
   109  
   110  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   111  
   112  # **GetOAuthClient**
   113  > NewClientRequest GetOAuthClient(ctx, apiID, keyName)
   114  Get OAuth client
   115  
   116  ### Required Parameters
   117  
   118  Name | Type | Description  | Notes
   119  ------------- | ------------- | ------------- | -------------
   120   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   121    **apiID** | **string**| The API ID | 
   122    **keyName** | **string**| The Client ID | 
   123  
   124  ### Return type
   125  
   126  [**NewClientRequest**](NewClientRequest.md)
   127  
   128  ### Authorization
   129  
   130  [api_key](../README.md#api_key)
   131  
   132  ### HTTP request headers
   133  
   134   - **Content-Type**: Not defined
   135   - **Accept**: application/json
   136  
   137  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   138  
   139  # **GetOAuthClientTokens**
   140  > []string GetOAuthClientTokens(ctx, apiID, keyName)
   141  List tokens
   142  
   143  This endpoint allows you to retrieve a list of all current tokens and their expiry date for a provided API ID and OAuth-client ID in the following format. This endpoint will work only for newly created tokens. <br/> <br/> You can control how long you want to store expired tokens in this list using `oauth_token_expired_retain_period` gateway option, which specifies retain period for expired tokens stored in Redis. By default expired token not get removed. See <a href=\"https://tyk.io/docs/configure/tyk-gateway-configuration-options/#a-name-oauth-token-expired-retain-period-a-oauth-token-expired-retain-period\" target=\"_blank\">here</a> for more details.
   144  
   145  ### Required Parameters
   146  
   147  Name | Type | Description  | Notes
   148  ------------- | ------------- | ------------- | -------------
   149   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   150    **apiID** | **string**| The API ID | 
   151    **keyName** | **string**| The Client ID | 
   152  
   153  ### Return type
   154  
   155  **[]string**
   156  
   157  ### Authorization
   158  
   159  [api_key](../README.md#api_key)
   160  
   161  ### HTTP request headers
   162  
   163   - **Content-Type**: Not defined
   164   - **Accept**: application/json
   165  
   166  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   167  
   168  # **InvalidateOAuthRefresh**
   169  > ApiModifyKeySuccess InvalidateOAuthRefresh(ctx, apiId, keyName)
   170  Invalidate OAuth refresh token
   171  
   172  It is possible to invalidate refresh tokens in order to manage OAuth client access more robustly.
   173  
   174  ### Required Parameters
   175  
   176  Name | Type | Description  | Notes
   177  ------------- | ------------- | ------------- | -------------
   178   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   179    **apiId** | **string**| The API id | 
   180    **keyName** | **string**| Refresh token | 
   181  
   182  ### Return type
   183  
   184  [**ApiModifyKeySuccess**](apiModifyKeySuccess.md)
   185  
   186  ### Authorization
   187  
   188  [api_key](../README.md#api_key)
   189  
   190  ### HTTP request headers
   191  
   192   - **Content-Type**: Not defined
   193   - **Accept**: application/json
   194  
   195  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   196  
   197  # **ListOAuthClients**
   198  > []NewClientRequest ListOAuthClients(ctx, apiID)
   199  List oAuth clients
   200  
   201  OAuth Clients are organised by API ID, and therefore are queried as such.
   202  
   203  ### Required Parameters
   204  
   205  Name | Type | Description  | Notes
   206  ------------- | ------------- | ------------- | -------------
   207   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   208    **apiID** | **string**| The API ID | 
   209  
   210  ### Return type
   211  
   212  [**[]NewClientRequest**](NewClientRequest.md)
   213  
   214  ### Authorization
   215  
   216  [api_key](../README.md#api_key)
   217  
   218  ### HTTP request headers
   219  
   220   - **Content-Type**: Not defined
   221   - **Accept**: application/json
   222  
   223  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   224  
   225  # **RevokeAllTokens**
   226  > RevokeAllTokens(ctx, clientId, clientSecret)
   227  revoke all client's tokens
   228  
   229  revoke all the tokens for a given oauth client
   230  
   231  ### Required Parameters
   232  
   233  Name | Type | Description  | Notes
   234  ------------- | ------------- | ------------- | -------------
   235   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   236    **clientId** | **string**|  | 
   237    **clientSecret** | **string**|  | 
   238  
   239  ### Return type
   240  
   241   (empty response body)
   242  
   243  ### Authorization
   244  
   245  [api_key](../README.md#api_key)
   246  
   247  ### HTTP request headers
   248  
   249   - **Content-Type**: application/x-www-form-urlencoded
   250   - **Accept**: Not defined
   251  
   252  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   253  
   254  # **RevokeSingleToken**
   255  > RevokeSingleToken(ctx, token, clientId, tokenTypeHint)
   256  revoke token
   257  
   258  revoke a single token
   259  
   260  ### Required Parameters
   261  
   262  Name | Type | Description  | Notes
   263  ------------- | ------------- | ------------- | -------------
   264   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   265    **token** | **string**|  | 
   266    **clientId** | **string**|  | 
   267    **tokenTypeHint** | **string**|  | 
   268  
   269  ### Return type
   270  
   271   (empty response body)
   272  
   273  ### Authorization
   274  
   275  [api_key](../README.md#api_key)
   276  
   277  ### HTTP request headers
   278  
   279   - **Content-Type**: application/x-www-form-urlencoded
   280   - **Accept**: Not defined
   281  
   282  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   283  
   284  # **UpdateoAuthClient**
   285  > []NewClientRequest UpdateoAuthClient(ctx, apiID)
   286  Update OAuth metadata and Policy ID
   287  
   288  Allows you to update the metadata and Policy ID for an OAuth client.
   289  
   290  ### Required Parameters
   291  
   292  Name | Type | Description  | Notes
   293  ------------- | ------------- | ------------- | -------------
   294   **ctx** | **context.Context** | context for authentication, logging, cancellation, deadlines, tracing, etc.
   295    **apiID** | **string**| The API ID | 
   296  
   297  ### Return type
   298  
   299  [**[]NewClientRequest**](NewClientRequest.md)
   300  
   301  ### Authorization
   302  
   303  [api_key](../README.md#api_key)
   304  
   305  ### HTTP request headers
   306  
   307   - **Content-Type**: Not defined
   308   - **Accept**: application/json
   309  
   310  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to Model list]](../README.md#documentation-for-models) [[Back to README]](../README.md)
   311