Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 87 additions & 0 deletions docs/source/Resources/Secrets/Secrets_Type.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
**Secrets Type**
===============


.. _SecretsInfo:

SecretsInfo
-----------

**Attributes:**

| id: :ref:`GenericID`
| Unique identifier for the secret.

| key: str
| Key name of the secret.

| tags: Optional[List[:ref:`TagsObj`]]
| List of tags associated with the secret.

| value_length: int
| Length of the secret value.

| created_at: datetime
| Date and time when the secret was created.

| updated_at: datetime
| Date and time when the secret was last updated.


.. _SecretsCreate:

SecretsCreate
-------------

**Attributes:**

| key: str
| Key name for the new secret.

| value: str
| Value of the secret.

| tags: Optional[List[:ref:`TagsObj`]]
| List of tags to associate with the secret.


.. _SecretsEdit:

SecretsEdit
----------

**Attributes:**

| value: Optional[str]
| New value for the secret.

| tags: Optional[List[:ref:`TagsObj`]]
| Updated list of tags for the secret.


.. _SecretsFilter:

SecretsFilter
------------

**Attributes:**

| key: str
| Key name to filter secrets by.

| tags: Optional[List[:ref:`TagsObj`]]
| Tags to filter secrets by.


.. _SecretsQuery:

SecretsQuery(:ref:`Query`)
------------

**Attributes:**

| fields: Optional[List[Literal["id", "key", "tags", "created_at", "updated_at"]]]
| List of fields to include in the query results.

| filter: Optional[:ref:`SecretsFilter`]
| Filter criteria for the query.
162 changes: 162 additions & 0 deletions docs/source/Resources/Secrets/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
**Secrets**
==========

Manage secrets in your application.

=======
list
=======

Retrieves a paginated list of all secrets stored in the profile with filtering and sorting options.

See: `Secrets <https://help.tago.io/portal/en/kb/articles/secrets>`_

**Parameters:**

| *Optional* **queryObj**: :ref:`SecretsQuery`
| Query parameters to filter the results.

.. code-block::
:caption: **Default queryObj:**

queryObj = {
"page": 1,
"fields": ["id", "key"],
"filter": {},
"amount": 20,
"orderBy": ["key", "asc"]
}

**Returns:**

| list[:ref:`SecretsInfo`]

.. code-block:: python

# If receive an error "Authorization Denied", check policy "Secrets" / "Access" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.secrets.list({
"page": 1,
"fields": ["id", "key"],
"amount": 20
})
print(result) # [ { 'id': 'secret-id-123', 'key': 'API_KEY' } ]


=======
info
=======

Retrieves detailed information about a specific secret using its ID.

See: `Secrets <https://help.tago.io/portal/en/kb/articles/secrets>`_

**Parameters:**

| **secretID**: str
| Secret ID

**Returns:**

| :ref:`SecretsInfo`

.. code-block:: python

# If receive an error "Authorization Denied", check policy "Secrets" / "Access" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
secret_info = resources.secrets.info("secret-id-123")
print(secret_info) # { 'id': 'secret-id-123', 'key': 'API_KEY' }


=======
create
=======

Creates a new secret in the profile with the specified key and value.

See: `Creating a Secret <https://help.tago.io/portal/en/kb/articles/secrets#Creating_a_Secret>`_

**Parameters:**

| **secretObj**: :ref:`SecretsCreate`
| Secret information

**Returns:**

| dict[str, :ref:`GenericID`]

.. code-block:: python

# If receive an error "Authorization Denied", check policy "Secrets" / "Create" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.secrets.create({
"key": "API_KEY",
"value": "my-secret-value"
})
print(result) # { 'id': 'secret-id-132' }


=======
edit
=======

Modifies the properties of an existing secret.

See: `Secrets <https://help.tago.io/portal/en/kb/articles/secrets>`_

**Parameters:**

| **secretID**: str
| Secret ID

| **secretObj**: :ref:`SecretsEdit`
| Secret information to update

**Returns:**

| string

.. code-block:: python

# If receive an error "Authorization Denied", check policy "Secrets" / "Edit" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.secrets.edit("secret-id-123", {
"value": "new-secret-value",
"tags": [{"key": "type", "value": "user"}]
})
print(result) # Successfully Updated


=======
delete
=======

Permanently removes a secret from the profile.

See: `Secrets <https://help.tago.io/portal/en/kb/articles/secrets>`_

**Parameters:**

| **secretID**: str
| Secret ID

**Returns:**

| string

.. code-block:: python

# If receive an error "Authorization Denied", check policy "Secrets" / "delete" in Access Management.
from tagoio_sdk import Resources

resources = Resources()
result = resources.secrets.delete("secret-id-123")
print(result) # Successfully Removed
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
**Service Authorization Types**
===============================


.. _GenericTokenAuthorization:

GenericToken
-----------

| **GenericToken**: str
| Token used on TagoIO, string with 34 characters


.. _TokenCreateResponseAuthorization:

TokenCreateResponse
-----------------

**Attributes:**

| token: :ref:`GenericTokenAuthorization`
| The authorization token.

| name: str
| Name of the token.

| profile: :ref:`GenericID`
| Profile ID associated with the token.

| additional_parameters: Optional[str]
| [Optional] Verification code to validate middleware requests.


.. _ServiceAuthorizationFilter:

ServiceAuthorizationFilter
------------------------

**Attributes:**

| name: str
| Name to filter service authorizations by.

| token: :ref:`GenericToken`
| Token to filter service authorizations by.


.. _ServiceAuthorizationQuery:

ServiceAuthorizationQuery(:ref:`Query`)
-------------------

**Attributes:**

| fields: Optional[List["name" or "token" or "verification_code" or "created_at"]]
| List of fields to include in the query results.

| filter: Optional[:ref:`ServiceAuthorizationFilter`]
| Filter criteria for the query.
Loading