Skip to content

Commit 8eccd5a

Browse files
Yoda-BZHTristan Charbonneau
and
Tristan Charbonneau
authored
feat(socket_authentication): allow unix_socket authentication
Co-authored-by: Tristan Charbonneau <[email protected]>
1 parent f1084e5 commit 8eccd5a

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

mysql/user.sls

+3
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ include:
4242
- password_hash: '{{ user['password_hash'] }}'
4343
{%- elif user['password'] is defined and user['password'] != None %}
4444
- password: '{{ user['password'] }}'
45+
{%- elif user['unix_socket'] is defined and user['unix_socket'] != None %}
46+
- allow_passwordless: True
47+
- unix_socket: True
4548
{%- else %}
4649
- allow_passwordless: True
4750
{%- endif %}

pillar.example

+7
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,13 @@ mysql:
135135
- database: bar
136136
table: foobar
137137
grants: ['select', 'insert', 'update', 'delete']
138+
139+
# User 'alice' will be allowed to connect to the server without password
140+
# as long as she has access to the unix socket.
141+
# This option forces allow_passwordless to be set to True
142+
alice:
143+
host: 'localhost'
144+
unix_socket: true
138145
nopassuser:
139146
password: ~
140147
host: localhost

0 commit comments

Comments
 (0)