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

Implements addAdbPublicKey API endpoint #770

Merged
merged 4 commits into from
Jul 10, 2019
Merged

Conversation

neofreko
Copy link

@neofreko neofreko commented Dec 5, 2017

Reason: manually approve adb connection from web UI does not scale for test automation. Especially those that are using different adb keys on each session (eg: via container)

This changes also added swagger doc endpoint. Using stf local command, it will end up at: http://localhost:7106/docs/

Akhmad Fathonih added 3 commits December 5, 2017 15:12
Reason: manually approve adb connection from web UI does not scale for test automation. Especially those that are using different adb keys on each session (eg: via container)

This changes also added swagger doc endpoint. Using `stf local` command, it will end up at: `http://localhost:7106/docs/`
return {
key: {
title: data.title || key.comment
, fingerprint: key.fingerprint
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small thing but could you reduce the indentation on every line that starts with a comma? The fields should line up.

neofreko pushed a commit to neofreko/stf-client that referenced this pull request Dec 6, 2017
@denis99999
Copy link
Contributor

Is this feature will be merged soon ?

})
}).catch(function(err) {
log.error('Failed to insert new adb key fingerprint: ', err.stack)
return res.status(500).json({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we distinguish cases when supplied key is malformed and respond with error 400 in such case?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adbkit does not provide a specific exception object we can catch. This is what adbkit do when encountering such input:

reject new Error "Unrecognizable public key format"

What we can do better here probably is passing through the error message. Would that be suffice?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@koral-- , is it possible now to merge soon this interesting feature ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay.
LGTM

What we can do better here probably is passing through the error message. Would that be suffice?

Stacktrace from that error is printed to the log so I think it is OK to leave it as is.

@denis99999
Copy link
Contributor

Actually, ADB keys are created through the UI, so for consistency is this feature includes the updating of the UI while creating ADB keys through the API ?

@stevelixin
Copy link

It is a great API enhancement, do you consider adding a new API to delete the ADBKey or purge all adbKeys?

@neofreko
Copy link
Author

Actually, ADB keys are created through the UI, so for consistency is this feature includes the updating of the UI while creating ADB keys through the API ?

@denis99999
This PR will also trigger the ADB keys update event. Current ADB keys management on UI part is depending on the same mechanism, AFAIK. So it'll be in sync.

@neofreko
Copy link
Author

It is a great API enhancement, do you consider adding a new API to delete the ADBKey or purge all adbKeys?

@stevelibuzz
Good point there, ADB keys may accumulate over time. Unfortunately, I don't have that kind of use case at the moment. Feel free to create follow up PR ;)

})
}).catch(function(err) {
log.error('Failed to insert new adb key fingerprint: ', err.stack)
return res.status(500).json({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for the delay.
LGTM

What we can do better here probably is passing through the error message. Would that be suffice?

Stacktrace from that error is printed to the log so I think it is OK to leave it as is.

@sorccu sorccu merged commit 16e64b5 into openstf:master Jul 10, 2019
@sorccu
Copy link
Member

sorccu commented Jul 10, 2019

Finally merged! Thanks :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants