-
Notifications
You must be signed in to change notification settings - Fork 51
Add support for access tokens to cli #477
Add support for access tokens to cli #477
Conversation
231282e
to
f4f9507
Compare
* Add support for authorization Bearer token * Add argument for JWT public key * Validate JWT access token when authorization enabled
f4f9507
to
fcaa92e
Compare
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.
works for me
fcaa92e
to
e6f3c2c
Compare
I could get this to run
But then I guess I met some documentation issues with client
It see I would suggest, that Also, why is "provide" working, but "actuate" not, is that intended? Generally, I think READMEs for databroker to be extended/updated to mention these features. Should also give at least a small example how to use it with databroker-cli (with warning that it is not fully implemented and maybe also mentioning kuksa-client (py) not yet supported) |
That's a bug, will push an update.
The intention is to add support for
Agreed |
e6f3c2c
to
0ca1b37
Compare
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.
✅ : Actuate working now
I still think "Unknown command" should give a hint to type help
This documentation
https://github.com/eclipse/kuksa.val/tree/master/kuksa_databroker
is outdated:
Need to have updated command line aprameters (and may one sentence for each where not obvious) here : https://github.com/eclipse/kuksa.val/tree/master/kuksa_databroker#test-the-databroker
It should at leat repair the cli examples here https://github.com/eclipse/kuksa.val/tree/master/kuksa_databroker#test-the-databroker
And update the quickstart hee https://github.com/eclipse/kuksa.val/blob/master/doc/quickstart.md
(not adding authorisation just changing "feed->provide" in the examples of databroker-cli
* Add support for command line arguments * Add initial support for subcommands * Start moving GRPC related parts into client.rs * A number of small updates to the interface
f95a456
to
256939b
Compare
256939b
to
30962e1
Compare
Done
Updated it, not sure I got it all.
Done as well, I think.. (I reverted renaming of commands for now as well) |
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.
I seem unlucky, I am still facing issues:
sdv.databroker.v1 > lol
Unknown command. See `help` for a list of available commands.
sdv.databroker.v1 > help
connect [URI] Connect to server
get <PATH> [[PATH] ...] Get signal value(s)
set <PATH> <VALUE> Set actuator signal
subscribe <QUERY> Subscribe to signals with QUERY
feed <PATH> <VALUE> Publish signal value
metadata [PATTERN] Fetch metadata. Provide PATTERN to list metadata of signals matching pattern.
token <TOKEN> Use TOKEN as access token
token-file <FILE> Use content of FILE as access token
help You're looking at it.
quit Quit
sdv.databroker.v1 > get Vehicle.ADAS.CruiseControl.IsEnabled
[get] OK
Vehicle.ADAS.CruiseControl.IsEnabled: ( NotAvailable )
sdv.databroker.v1 > feed Vehicle.ADAS.CruiseControl.IsEnabled
Usage: feed <PATH> <VALUE>
sdv.databroker.v1 > feed Vehicle.ADAS.CruiseControl.IsEnabled true
No metadata available for Vehicle.ADAS.CruiseControl.IsEnabled. Needed to determine data type for serialization.
sdv.databroker.v1 > feed Vehicle.Speed 200
No metadata available for Vehicle.Speed. Needed to determine data type for serialization.
sdv.databroker.v1 > metadata Vehicle.ADAS.CruiseControl.IsEnabled
[metadata] OK
Path Entry type Data type
Vehicle.ADAS.CruiseControl.IsEnabled Actuator Bool
sdv.databroker.v1 >
No, you just put a spotlight on a usability issue (that wasn't there before adding authorization). I'm assuming you started unauthenticated, which means the metadata couldn't be fetched on startup. The lack of metadata is communicated, but since this behaviour is new it's not obvious why it's missing. It could have been remedied by running But I don't see why you should need to run that manually. Pushed an additional commit adding automatic fetching of metadata after setting a new access token. |
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.
Finally 🌵
Adds support for access tokens to databroker-cli.
Included are a number of other improvements. Some necessary for adding this support, some not. E.g.