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

Conditional Client API token #653

Open
qedgardo opened this issue Jul 4, 2024 · 0 comments
Open

Conditional Client API token #653

qedgardo opened this issue Jul 4, 2024 · 0 comments
Labels
new-feature-request Feature request that needs triage

Comments

@qedgardo
Copy link

qedgardo commented Jul 4, 2024

Problem

By default, Algorand public APIs require an algod_token to be consumed. However, it also allows the option to disable API authentication. When API auth is disabled, the request to the algod node can't be done since the algod token is always required by the client in go-algorand-sdk

Solution

A potential solution could be to include a condition on client.apiToken

if len(client.apiToken) > 0 {
    req.Header.Set(client.apiHeader, client.apiToken)
}
@qedgardo qedgardo added the new-feature-request Feature request that needs triage label Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new-feature-request Feature request that needs triage
Projects
None yet
Development

No branches or pull requests

1 participant