-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Re-enable livemode key management (#982)
* wip * wip * refactor * remove comments * remove extra imports * remove unused imports * fix typo * bug fix * remove livemode api key at logout
- Loading branch information
1 parent
65571fc
commit e0b09ae
Showing
8 changed files
with
250 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//go:build !arm64 | ||
// +build !arm64 | ||
|
||
package config | ||
|
||
func deleteLivemodeKey(key string, profile string) error { | ||
fieldID := profile + "." + key | ||
existingKeys, err := KeyRing.Keys() | ||
if err != nil { | ||
return err | ||
} | ||
for _, item := range existingKeys { | ||
if item == fieldID { | ||
KeyRing.Remove(fieldID) | ||
return nil | ||
} | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
//go:build arm64 | ||
// +build arm64 | ||
|
||
package config | ||
|
||
import exec "golang.org/x/sys/execabs" | ||
|
||
func deleteLivemodeKey(key string, profile string) error { | ||
fieldID := profile + "." + key | ||
_, err := exec.Command( | ||
execPathKeychain, | ||
"delete-generic-password", | ||
"-s", fieldID, | ||
"-a", KeyManagementService).CombinedOutput() | ||
if err != nil { | ||
return err | ||
} | ||
return nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.