You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When an API key is set, the SDK instance should hit the /team/me API endpoint to quickly determine_ if the initialized SDK instance will have authentication issues.
Why?
This will catch any authentication issues immediately instead of waiting until a particular method is used, such as circuit-create.
Notably, the circuit-create method, which uploads a local directory to the Sindri API, will compress the directory into a tar.gz archive in memory before it attempts to make the API request. With large circuits that include sizable data, this compression phase can take several minutes. Very often, especially with examples and demos, the circuit-create method is the first call that is made with the SDK. If the API key is invalid, it is possible that the user will wait several minutes for this compression process to complete before the API endpoint returns an error.
Sindri already introduced this pattern in other analogous Sindri SDKs they maintain.
Implementation Notes
This additional API call to /team/me would most likely go in the authorize() method instead of just in the SDK constructor. This way, a user can reuse an existing SDK instance to modify its authorization.
The text was updated successfully, but these errors were encountered:
What?
When an API key is set, the SDK instance should hit the /team/me API endpoint to quickly determine_ if the initialized SDK instance will have authentication issues.
Why?
This will catch any authentication issues immediately instead of waiting until a particular method is used, such as circuit-create.
Notably, the circuit-create method, which uploads a local directory to the Sindri API, will compress the directory into a tar.gz archive in memory before it attempts to make the API request. With large circuits that include sizable data, this compression phase can take several minutes. Very often, especially with examples and demos, the circuit-create method is the first call that is made with the SDK. If the API key is invalid, it is possible that the user will wait several minutes for this compression process to complete before the API endpoint returns an error.
Sindri already introduced this pattern in other analogous Sindri SDKs they maintain.
Implementation Notes
This additional API call to /team/me would most likely go in the
authorize()
method instead of just in the SDK constructor. This way, a user can reuse an existing SDK instance to modify its authorization.The text was updated successfully, but these errors were encountered: