File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -8,9 +8,16 @@ _delete_keychain() {
88 security delete-keychain " ${PW_KEYCHAIN} "
99}
1010
11- _config_append_macos_keychain () {
11+ _config_append_macos_keychain_keychain_access_control_always_allow () {
1212 cat >> " ${PW_CONFIG} " << EOF
1313[macos_keychain]
1414keychain_access_control = always-allow
1515EOF
1616}
17+
18+ _config_append_macos_keychain_keychain_access_control_confirm () {
19+ cat >> " ${PW_CONFIG} " << EOF
20+ [macos_keychain]
21+ keychain_access_control = confirm
22+ EOF
23+ }
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ setup() {
88 _set_config_with_copy_paste
99 # shellcheck disable=SC2016
1010 _config_append_with_plugin ' $PW_HOME/plugins/macos_keychain'
11- _config_append_macos_keychain
11+ _config_append_macos_keychain_keychain_access_control_always_allow
1212 pw init " ${PW_KEYCHAIN} " <<< " ${KEYCHAIN_TEST_PASSWORD}"
1313}
1414
@@ -181,6 +181,21 @@ ${MULTI_LINE_NOTES}
181181EOF
182182}
183183
184+ @test " adds item with access control always-allow" {
185+ assert_adds_item " ${PW_1} " " ${NAME_A} "
186+ run security dump-keychain -a " ${PW_KEYCHAIN} "
187+ assert_success
188+ assert_output --partial " com.apple.security"
189+ }
190+
191+ @test " adds item with access control confirm" {
192+ _config_append_macos_keychain_keychain_access_control_confirm
193+ assert_adds_item " ${PW_1} " " ${NAME_A} "
194+ run security dump-keychain -a " ${PW_KEYCHAIN} "
195+ assert_success
196+ refute_output --partial " com.apple.security"
197+ }
198+
184199# ###############################################################################
185200# add another
186201# ###############################################################################
You can’t perform that action at this time.
0 commit comments