@@ -58,6 +58,9 @@ func (c *cliStoreAdapter) AssignKeyToAccount(keyID, accountID int) error {
5858 }
5959 return km .AssignKeyToAccount (keyID , accountID )
6060}
61+ func (c * cliStoreAdapter ) UpdateAccountIsDirty (id int , dirty bool ) error {
62+ return db .UpdateAccountIsDirty (id , dirty )
63+ }
6164func (c * cliStoreAdapter ) CreateSystemKey (publicKey , privateKey string ) (int , error ) {
6265 return db .CreateSystemKey (publicKey , privateKey )
6366}
@@ -193,8 +196,17 @@ func (w *dbStoreWrapper) GetAccount(id int) (*model.Account, error) {
193196func (w * dbStoreWrapper ) AddAccount (username , hostname , label , tags string ) (int , error ) {
194197 return w .inner .AddAccount (username , hostname , label , tags )
195198}
196- func (w * dbStoreWrapper ) DeleteAccount (accountID int ) error { return w .inner .DeleteAccount (accountID ) }
197- func (w * dbStoreWrapper ) AssignKeyToAccount (keyID , accountID int ) error { return nil }
199+ func (w * dbStoreWrapper ) DeleteAccount (accountID int ) error { return w .inner .DeleteAccount (accountID ) }
200+ func (w * dbStoreWrapper ) AssignKeyToAccount (keyID , accountID int ) error {
201+ km := db .DefaultKeyManager ()
202+ if km == nil {
203+ return fmt .Errorf ("no key manager available" )
204+ }
205+ return km .AssignKeyToAccount (keyID , accountID )
206+ }
207+ func (w * dbStoreWrapper ) UpdateAccountIsDirty (id int , dirty bool ) error {
208+ return w .inner .UpdateAccountIsDirty (id , dirty )
209+ }
198210func (w * dbStoreWrapper ) CreateSystemKey (publicKey , privateKey string ) (int , error ) {
199211 return w .inner .CreateSystemKey (publicKey , privateKey )
200212}
0 commit comments