Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow the Search Only and Admin API keys to be created #1

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

huib-coalesce
Copy link

After creating a Typesense cluster, I want to be able to add a Search Only and Admin API key.

This PR allows the API keys to be created for a Typesense cluster:

resource "typesense_cluster_api_keys" "example" {
  cluster_id = "kvzb3qlwp27v19r4b"
}

Under the hood this performs:

curl --request POST \
     --url 'https://cloud.typesense.org/api/v1/clusters/<cluster-id>/api-keys' \
     --header 'X-TYPESENSE-CLOUD-MANAGEMENT-API-KEY: Us...Yk::6x...83' \
     --header 'Accept: application/json'

Which returns something like:

{
    "success": true,
    "api_keys": {
        "admin_key": "cBKqFPEcGRAS7RIKi3h3FuJbj4Q9Rprk",
        "search_only_key": "y7CFw2zEgu09FFhoDgLzC99j0RwKi0kL"
    }
}

The generated Admin key is configured with: Actions [*], Collections [*]
The generated Search Only key is configured with: Actions [documents:search], Collections [*]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant