forked from snowflakedb/snowflake-connector-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathauth_default.py
37 lines (30 loc) · 795 Bytes
/
auth_default.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2012-2019 Snowflake Computing Inc. All right reserved.
#
from .auth import AuthByPlugin
class AuthByDefault(AuthByPlugin):
"""
Default username and password authenticator
"""
@property
def assertion_content(self):
return "*********"
def __init__(self, password):
"""
Initializes an instance with a password
"""
self._password = password
def authenticate(
self, authenticator, service_name, account, user, password):
"""
NOP.
"""
pass
def update_body(self, body):
"""
Set the password if available
"""
if self._password:
body[u'data'][u"PASSWORD"] = self._password