Skip to content

Commit bc86d7c

Browse files
authored
Remove create_connection and promote_draft_connection methods (#69)
1 parent e767631 commit bc86d7c

File tree

2 files changed

+0
-69
lines changed

2 files changed

+0
-69
lines changed

tests/test_sso.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -214,31 +214,6 @@ def test_get_profile_and_token_returns_expected_workosprofile_object(
214214
assert profile_and_token.access_token == "01DY34ACQTM3B1CSX1YSZ8Z00D"
215215
assert profile_and_token.profile.to_dict() == mock_profile
216216

217-
def test_create_connection(
218-
self, setup_with_client_id, mock_request_method, mock_connection
219-
):
220-
response_dict = {
221-
"object": "connection",
222-
"id": mock_connection["id"],
223-
"name": mock_connection["name"],
224-
"status": mock_connection["status"],
225-
"connection_type": mock_connection["connection_type"],
226-
"oauth_uid": mock_connection["oauth_uid"],
227-
"oauth_secret": mock_connection["oauth_secret"],
228-
"oauth_redirect_uri": mock_connection["oauth_redirect_uri"],
229-
"saml_entity_id": mock_connection["saml_entity_id"],
230-
"saml_idp_url": mock_connection["saml_idp_url"],
231-
"saml_relying_party_trust_cert": mock_connection[
232-
"saml_relying_party_trust_cert"
233-
],
234-
"saml_x509_certs": mock_connection["saml_x509_certs"],
235-
"domains": mock_connection["domains"],
236-
}
237-
mock_request_method("post", mock_connection, 201)
238-
239-
connection = self.sso.create_connection("draft_conn_id")
240-
assert connection == response_dict
241-
242217
def test_get_connection(
243218
self, setup_with_client_id, mock_connection, mock_request_method
244219
):

workos/sso.py

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
from workos.utils.validation import SSO_MODULE, validate_settings
1818

1919
AUTHORIZATION_PATH = "sso/authorize"
20-
CREATE_CONNECTION_PATH = "connections"
21-
PROMOTE_DRAFT_CONNECTION_PATH = "draft_connections/%s/activate"
2220
TOKEN_PATH = "sso/token"
2321

2422
OAUTH_GRANT_TYPE = "authorization_code"
@@ -113,48 +111,6 @@ def get_profile_and_token(self, code):
113111

114112
return WorkOSProfileAndToken.construct_from_response(response)
115113

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-
158114
def get_connection(self, connection):
159115
"""Gets details for a single Connection
160116

0 commit comments

Comments
 (0)