Ability to set callback that return fresh API Key

オープン
#1,307 コメント 6 件 リアクション 1 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
javascript, typescript
領域
api

調査の方向性

ソースファイルもテストも指定されていません。まず searchclient の作成と API キーの使用を追跡し、次に InstantSearch がクライアントの変更を監視し、クエリキャッシュを維持する方法を調べてください。クライアントを置き換えたりクエリを重複させたりせずに、callback のタイミングと更新動作について合意できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Context :
Following the issue #772, we can now check remaining validity of API Key.

Problem :
In our application, we are generating very short term API Keys (5 minutes) to always be compliant with filters and visibility that are set in the Key (from our backend according to user access rights).

It could be very cool to add a callback while creating the searchclient which will be called when API Key is near expiration and which should return a fresh API Key.

Workaround :
Currently, we are wrapping the search methods from searchclient into some of our wrappers that do the check before every request.
If we detect that API Key is expired, we generate a new searchclient with the updated API Key and use it to execute the query.
However there is two bad concerns about this workaround :

  1. As searchclient instance change, the InstantSearch node seems to detect it and relaunch a new query (which is now duplicated).
  2. As searchclient instance change, what happen to the currently built query cache ? Reset ?

Yours faithfully,
LCDP

主要言語
TypeScript
スター
1.4k
フォーク
227
PR マージ指標
30日以内にマージされた PR はありません

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

algolia/algoliasearch-client-javascript のほかの issue

algolia/algoliasearch-client-javascript の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。