bunnyshell.com/sdk@v0.16.0/docs/SecretAPI.md (about)

     1  # \SecretAPI
     2  
     3  All URIs are relative to *https://api.environments.bunnyshell.com*
     4  
     5  Method | HTTP request | Description
     6  ------------- | ------------- | -------------
     7  [**SecretDecrypt**](SecretAPI.md#SecretDecrypt) | **Post** /v1/secrets/decrypt | Decrypt a cipher text.
     8  [**SecretEncrypt**](SecretAPI.md#SecretEncrypt) | **Post** /v1/secrets/encrypt | Encrypt a plain text.
     9  [**SecretTranscryptConfiguration**](SecretAPI.md#SecretTranscryptConfiguration) | **Post** /v1/secrets/transcrypt-configuration | Encrypt or decrypt secrets from an environment configuration.
    10  
    11  
    12  
    13  ## SecretDecrypt
    14  
    15  > SecretDecryptedItem SecretDecrypt(ctx).SecretDecryptAction(secretDecryptAction).Execute()
    16  
    17  Decrypt a cipher text.
    18  
    19  
    20  
    21  ### Example
    22  
    23  ```go
    24  package main
    25  
    26  import (
    27      "context"
    28      "fmt"
    29      "os"
    30      openapiclient "bunnyshell.com/sdk"
    31  )
    32  
    33  func main() {
    34      secretDecryptAction := *openapiclient.NewSecretDecryptAction("Expression_example", "Organization_example") // SecretDecryptAction | The new secret resource
    35  
    36      configuration := openapiclient.NewConfiguration()
    37      apiClient := openapiclient.NewAPIClient(configuration)
    38      resp, r, err := apiClient.SecretAPI.SecretDecrypt(context.Background()).SecretDecryptAction(secretDecryptAction).Execute()
    39      if err != nil {
    40          fmt.Fprintf(os.Stderr, "Error when calling `SecretAPI.SecretDecrypt``: %v\n", err)
    41          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    42      }
    43      // response from `SecretDecrypt`: SecretDecryptedItem
    44      fmt.Fprintf(os.Stdout, "Response from `SecretAPI.SecretDecrypt`: %v\n", resp)
    45  }
    46  ```
    47  
    48  ### Path Parameters
    49  
    50  
    51  
    52  ### Other Parameters
    53  
    54  Other parameters are passed through a pointer to a apiSecretDecryptRequest struct via the builder pattern
    55  
    56  
    57  Name | Type | Description  | Notes
    58  ------------- | ------------- | ------------- | -------------
    59   **secretDecryptAction** | [**SecretDecryptAction**](SecretDecryptAction.md) | The new secret resource | 
    60  
    61  ### Return type
    62  
    63  [**SecretDecryptedItem**](SecretDecryptedItem.md)
    64  
    65  ### Authorization
    66  
    67  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
    68  
    69  ### HTTP request headers
    70  
    71  - **Content-Type**: application/json
    72  - **Accept**: application/hal+json, application/problem+json
    73  
    74  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
    75  [[Back to Model list]](../README.md#documentation-for-models)
    76  [[Back to README]](../README.md)
    77  
    78  
    79  ## SecretEncrypt
    80  
    81  > SecretEncryptedItem SecretEncrypt(ctx).SecretEncryptAction(secretEncryptAction).Execute()
    82  
    83  Encrypt a plain text.
    84  
    85  
    86  
    87  ### Example
    88  
    89  ```go
    90  package main
    91  
    92  import (
    93      "context"
    94      "fmt"
    95      "os"
    96      openapiclient "bunnyshell.com/sdk"
    97  )
    98  
    99  func main() {
   100      secretEncryptAction := *openapiclient.NewSecretEncryptAction("PlainText_example", "Organization_example") // SecretEncryptAction | The new secret resource
   101  
   102      configuration := openapiclient.NewConfiguration()
   103      apiClient := openapiclient.NewAPIClient(configuration)
   104      resp, r, err := apiClient.SecretAPI.SecretEncrypt(context.Background()).SecretEncryptAction(secretEncryptAction).Execute()
   105      if err != nil {
   106          fmt.Fprintf(os.Stderr, "Error when calling `SecretAPI.SecretEncrypt``: %v\n", err)
   107          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   108      }
   109      // response from `SecretEncrypt`: SecretEncryptedItem
   110      fmt.Fprintf(os.Stdout, "Response from `SecretAPI.SecretEncrypt`: %v\n", resp)
   111  }
   112  ```
   113  
   114  ### Path Parameters
   115  
   116  
   117  
   118  ### Other Parameters
   119  
   120  Other parameters are passed through a pointer to a apiSecretEncryptRequest struct via the builder pattern
   121  
   122  
   123  Name | Type | Description  | Notes
   124  ------------- | ------------- | ------------- | -------------
   125   **secretEncryptAction** | [**SecretEncryptAction**](SecretEncryptAction.md) | The new secret resource | 
   126  
   127  ### Return type
   128  
   129  [**SecretEncryptedItem**](SecretEncryptedItem.md)
   130  
   131  ### Authorization
   132  
   133  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   134  
   135  ### HTTP request headers
   136  
   137  - **Content-Type**: application/json
   138  - **Accept**: application/hal+json, application/problem+json
   139  
   140  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   141  [[Back to Model list]](../README.md#documentation-for-models)
   142  [[Back to README]](../README.md)
   143  
   144  
   145  ## SecretTranscryptConfiguration
   146  
   147  > map[string]interface{} SecretTranscryptConfiguration(ctx).SecretTranscryptConfigurationAction(secretTranscryptConfigurationAction).Execute()
   148  
   149  Encrypt or decrypt secrets from an environment configuration.
   150  
   151  
   152  
   153  ### Example
   154  
   155  ```go
   156  package main
   157  
   158  import (
   159      "context"
   160      "fmt"
   161      "os"
   162      openapiclient "bunnyshell.com/sdk"
   163  )
   164  
   165  func main() {
   166      secretTranscryptConfigurationAction := *openapiclient.NewSecretTranscryptConfigurationAction("Yaml_example", "Mode_example", "Organization_example") // SecretTranscryptConfigurationAction | The new secret resource
   167  
   168      configuration := openapiclient.NewConfiguration()
   169      apiClient := openapiclient.NewAPIClient(configuration)
   170      resp, r, err := apiClient.SecretAPI.SecretTranscryptConfiguration(context.Background()).SecretTranscryptConfigurationAction(secretTranscryptConfigurationAction).Execute()
   171      if err != nil {
   172          fmt.Fprintf(os.Stderr, "Error when calling `SecretAPI.SecretTranscryptConfiguration``: %v\n", err)
   173          fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
   174      }
   175      // response from `SecretTranscryptConfiguration`: map[string]interface{}
   176      fmt.Fprintf(os.Stdout, "Response from `SecretAPI.SecretTranscryptConfiguration`: %v\n", resp)
   177  }
   178  ```
   179  
   180  ### Path Parameters
   181  
   182  
   183  
   184  ### Other Parameters
   185  
   186  Other parameters are passed through a pointer to a apiSecretTranscryptConfigurationRequest struct via the builder pattern
   187  
   188  
   189  Name | Type | Description  | Notes
   190  ------------- | ------------- | ------------- | -------------
   191   **secretTranscryptConfigurationAction** | [**SecretTranscryptConfigurationAction**](SecretTranscryptConfigurationAction.md) | The new secret resource | 
   192  
   193  ### Return type
   194  
   195  **map[string]interface{}**
   196  
   197  ### Authorization
   198  
   199  [JWT](../README.md#JWT), [ApiKeyAuth](../README.md#ApiKeyAuth)
   200  
   201  ### HTTP request headers
   202  
   203  - **Content-Type**: application/json
   204  - **Accept**: application/x+yaml, application/problem+json
   205  
   206  [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints)
   207  [[Back to Model list]](../README.md#documentation-for-models)
   208  [[Back to README]](../README.md)
   209