|
17 | 17 | from workos.utils.validation import SSO_MODULE, validate_settings |
18 | 18 |
|
19 | 19 | AUTHORIZATION_PATH = "sso/authorize" |
20 | | -CREATE_CONNECTION_PATH = "connections" |
21 | | -PROMOTE_DRAFT_CONNECTION_PATH = "draft_connections/%s/activate" |
22 | 20 | TOKEN_PATH = "sso/token" |
23 | 21 |
|
24 | 22 | OAUTH_GRANT_TYPE = "authorization_code" |
@@ -113,48 +111,6 @@ def get_profile_and_token(self, code): |
113 | 111 |
|
114 | 112 | return WorkOSProfileAndToken.construct_from_response(response) |
115 | 113 |
|
116 | | - def promote_draft_connection(self, token): |
117 | | - """Promote a Draft Connection |
118 | | -
|
119 | | - Promotes a Draft Connection created through the WorkOS.js embed. A Draft Connection that has |
120 | | - been promoted will enable Enterprise users of the domain to begin signing in via SSO. |
121 | | -
|
122 | | - Args: |
123 | | - token (str): The token supplied via the response when a draft connection is created via |
124 | | - the WorkOS.js embed |
125 | | -
|
126 | | - Returns: |
127 | | - bool: True if a Draft Connection has been successfully promoted |
128 | | - """ |
129 | | - warn( |
130 | | - "'promote_draft_connection' is deprecated. Use 'create_connection' instead.", |
131 | | - DeprecationWarning, |
132 | | - ) |
133 | | - self.request_helper.request( |
134 | | - PROMOTE_DRAFT_CONNECTION_PATH % token, |
135 | | - method=REQUEST_METHOD_POST, |
136 | | - token=workos.api_key, |
137 | | - ) |
138 | | - |
139 | | - return True |
140 | | - |
141 | | - def create_connection(self, source): |
142 | | - """Activates a Draft Connection created through the WorkOS.js widget. |
143 | | -
|
144 | | - Args: |
145 | | - source (str): Draft Connection identifier. |
146 | | -
|
147 | | - Returns: |
148 | | - dict: Created Connection response from WorkOS. |
149 | | - """ |
150 | | - params = {"source": source} |
151 | | - return self.request_helper.request( |
152 | | - CREATE_CONNECTION_PATH, |
153 | | - method=REQUEST_METHOD_POST, |
154 | | - params=params, |
155 | | - token=workos.api_key, |
156 | | - ) |
157 | | - |
158 | 114 | def get_connection(self, connection): |
159 | 115 | """Gets details for a single Connection |
160 | 116 |
|
|
0 commit comments