-
Notifications
You must be signed in to change notification settings - Fork 64
RSDK-4528 - Allow API keys for cloud apis + allow users to specify app url #424
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,12 +25,9 @@ | |
|
||
@dataclass | ||
class Credentials: | ||
"""Credentials to connect to the robot. | ||
"""Credentials to connect to the robot and the Viam app.""" | ||
|
||
Currently only supports robot location secret. | ||
""" | ||
|
||
type: Union[Literal["robot-location-secret"], Literal["robot-secret"]] | ||
type: Union[Literal["robot-location-secret"], Literal["robot-secret"], Literal["api-key"]] | ||
"""The type of credential | ||
""" | ||
|
||
|
@@ -314,5 +311,5 @@ async def dial_direct(address: str, options: Optional[DialOptions] = None) -> Ch | |
return await _dial_direct(address, options) | ||
|
||
|
||
async def _dial_app(options: DialOptions) -> Channel: | ||
return await _dial_direct("app.viam.com:443") | ||
async def _dial_app(app_url: str) -> Channel: | ||
return await _dial_direct(app_url) | ||
Comment on lines
+314
to
+315
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [q] I see that above in this file we do:
Should we maybe have it default to There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok! I'm not sure I follow why keeping it as |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[q] Should we add validation on this field such that users would get an error if they supplied a bad literal/typo? I'm surprised I was able to supply the
api-key
string in the original org API key PR without hitting any errors.Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it's just a type hint right now, so no error - the idea was that users could supply other cred types as the server changes without changes in the SDK, which I think is nicer - the server can/will reject if the type is incorrect anyway. I do think we could perhaps prepopulate these types, but out of scope for now (https://viam.atlassian.net/browse/RSDK-4756 could/should handle this better)