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

Add support for mulltiple API keys per cluster #175

Closed
elieobeid7 opened this issue Oct 8, 2023 · 2 comments
Closed

Add support for mulltiple API keys per cluster #175

elieobeid7 opened this issue Oct 8, 2023 · 2 comments

Comments

@elieobeid7
Copy link

elieobeid7 commented Oct 8, 2023

I reported this issue typesense/firestore-typesense-search#60 and I thought, it's a Firebase plugin issue, turns out the javascript library accepts only one key for all nodes which makes no sense, is this by design?

All Typesense libraries support one key per cluster, why?

Is it because you only set up a cluster using private IPs and you never thought that someone like me would want to set up servers in multiple data centers? So if a cluster is accessible privately only it's secure by design, this is the main reason, right?

@elieobeid7 elieobeid7 changed the title Add support for mulltiple API keys Add support for mulltiple API keys per cluster Oct 8, 2023
@jasonbosco
Copy link
Member

To use multiple API keys, you'd simply instantiate multiple instances of the client each with a separate API key... and use the appropriate client instance to call the methods needed.

Eg:

const typesense1 = new Typesense.Client({
  nodes: [
    {
      host: "hostname",
      port: "443",
      protocol: "https",
    },
  ],
  apiKey: 'APIKEY-ABC',
});


const typesense2 = new Typesense.Client({
  nodes: [
    {
      host: "hostname",
      port: "443",
      protocol: "https",
    },
  ],
  apiKey: 'APIKEY-XYZ,
});

you only set up a cluster using private IPs... a cluster is accessible privately only it's secure by design

No, Typesense can indeed be exposed to the internet using public IPs.

you never thought that someone like me would want to set up servers in multiple data centers

No, Typesense is indeed designed to be run across multiple data centers. We run thousands of nodes this way across 80 data centers in Typesense Cloud.

@elieobeid7
Copy link
Author

elieobeid7 commented Oct 15, 2023

We both know this isn't ideal, closing this ticket as it seems to me, this won't be fixed. I added one key for all servers and called it a day since I refuse to write such code.

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

No branches or pull requests

2 participants