Using 'createTritonApiClient' and setting profile.privKey throws error
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- javascript, node.js
Research direction
Start in TritonApi._setupProfile and compare its use of auth.KeyPair.fromPrivateKey with the exports in smartdc-auth's lib/index.js. Reproduce the failure by creating a TritonApi client with profile.privKey supplied from an environment variable, then verify that this setup no longer throws the reported TypeError.
Written by the indexing model from the issue text.
Description
First, some background on what I'm trying to do...
I'd like to be able to use this tool in a Node.js app which is deployed in a Docker container and be able to pass in the private key as an enviroment variable.
To do this, I'm using the 'createTritonApiClient' function to create an instance of TritonApi, passing in a profile object with the privKey property set from the env variable. So far, so good.
However, when I do this, I get the error "TypeError: Cannot read property 'fromPrivateKey' of undefined".
Doing a little digging, it looks like these are the relevant lines in 'TritonApi._setupProfile':
var auth = require('smartdc-auth');
...
auth.KeyPair.fromPrivateKey(key)
The problem appears to be that KeyPair isn't listed as export in the 'smartdc-auth' module.
If I add KeyPair as an export in my local copy of the 'smartdc-auth' module, everything works as expected.
- Dominant language
- JavaScript
- Stars
- 60
- Forks
- 36
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 1
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from TritonDataCenter/node-triton
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
TritonDataCenter/node-triton#262 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
TritonDataCenter/node-triton#251 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 25/100
TritonDataCenter/node-triton#241 ·
-
TritonDataCenter/node-triton#240 · 3 comments · 1 assignee ·
-
Difficulty 3/5 1-2 days Newbie friendliness 20/100
TritonDataCenter/node-triton#239 ·
All issues in TritonDataCenter/node-triton
Similar issues
-
code-quality refactoring
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
github/gh-aw-firewall#8816 ·
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
optimization optimization:agents-md-curator
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
githubnext/gh-aw-cao#13143 ·
-
status: needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100