-
Notifications
You must be signed in to change notification settings - Fork 17
Add ChangePassword API method #146
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
base: master
Are you sure you want to change the base?
Conversation
| return nil | ||
| } | ||
|
|
||
| func (device *Device) ChangePassword() error { |
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.
Please add a docstring
api/firmware/system_test.go
Outdated
| func TestSimulatorChangePassword(t *testing.T) { | ||
| testInitializedSimulators(t, func(t *testing.T, device *Device, stdOut *bytes.Buffer) { | ||
| t.Helper() | ||
| require.NoError(t, device.ChangePassword()) |
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.
This will fail on simulators <v9.25, so something like this will be needed:
bitbox02-api-go/api/firmware/btc_test.go
Lines 802 to 812 in c2ba9af
| if device.version.AtLeast(semver.NewSemVer(9, 21, 0)) { | |
| require.NoError(t, err) | |
| require.Equal(t, | |
| map[int][]byte{ | |
| 1: unhex("5120f99b8e8d97aa7b068dd7b4e7ae31f51784f5c2a0cae280748cfd23832b7dcba7"), | |
| }, | |
| result.GeneratedOutputs, | |
| ) | |
| } else { | |
| require.EqualError(t, err, UnsupportedError("9.21.0").Error()) | |
| } |
Add support for changing the device password on an initialized BitBox02. Changes: - Add ChangePasswordRequest protobuf message to bitbox02_system.proto - Add change_password field to Request oneof in hww.proto - Implement ChangePassword() method in system.go - Add firmware version check (requires v9.25.0+) - Add status validation (device must be StatusInitialized) - Add TestSimulatorChangePassword test coverage - Regenerate protobuf Go files The ChangePassword() method validates device state and firmware version before initiating the password change workflow on the device.
c0a17a6 to
8d2cb78
Compare
benma
left a comment
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.
utACK, nice! Please merge 😄
Add support for changing the device password on an initialized BitBox02.
Changes:
The ChangePassword() method validates device state and firmware version before initiating the password change workflow on the device.