Files
Olares/docs/developer/develop/advanced/secret.md

2.9 KiB

outline
outline
2
3

Secret

In an app, it's often necessary to save some important user information, such as passwords and Access Tokens for external systems. beOS Pro provides a unified Vault, based on Infisical, to securely store various keys.

To retrieve this information, the app only needs a simple application for API access permission. This can be done by adding a sysData permission to the beOS ProManifest.yaml in the application chart.

permission:
  sysData:
    - dataType: secret
      group: secret.infisical
      version: v1
      ops:
        - RetrieveSecret?workspace=your-app # Each app should define its own workspace
        - CreateSecret?workspace=your-app
        - DeleteSecret?workspace=your-app
        - UpdateSecret?workspace=your-app
        - ListSecret?workspace=your-app

Call API

You can call the API in the same way you would request other providers. Use the full name of ops (including the workspace parameter) as the URI.

Please include this header in all requests.

X-Authorization: token          # auth_token in cookie

RetrieveSecret

  • Request Body
    {
      "name": "string", // secret name
      "env": "string" // environment of secret, test | dev | staging | prod (default)
    }
    
  • Success Response
    {
      "code": http.StatusOK, // 200 is ok
      "message": "",
      "data":{
        "name": "string", // secret name
        "value": "string", // secret value
        "env": "string" // environment of secret, test | dev | staging | prod
      }
    }
    

CreateSecret

  • Request Body

    {
      "name": "string", // secret name
      "value": "string", // secret value
      "env": "string" // environment of secret, test | dev | staging | prod (default)
    }
    
  • Success Response

    {
      "code": http.StatusOK, // 200 is ok
      "message": "",
      "data":""
    }
    

DeleteSecret

  • Request Body

    {
      "name": "string", // secret name
      "env": "string" // environment of secret, test | dev | staging | prod (default)
    }
    
  • Success Response

    {
      "code": http.StatusOK, // 200 is ok
      "message": "",
      "data":""
    }
    

UpdateSecret

  • Request Body

    {
      "name": "string", // secret name
      "value": "string", // secret value
      "env": "string" // environment of secret, test | dev | staging | prod (default)
    }
    
  • Success Response

    {
      "code": http.StatusOK, // 200 is ok
      "message": "",
      "data":""
    }
    

ListSecret

  • Request Body

    {
      "env": "string" // environment of secret, test | dev | staging | prod (default)
    }
    
  • Success Response

    {
      "code": http.StatusOK, // 200 is ok
      "message": "",
      "data":{
        "name": "string", // secret name
        "value": "string", // secret value
        "env": "string" // environment of secret, test | dev | staging | prod
      }
    }