55from slack_bolt .request import BoltRequest
66from slack_bolt .response import BoltResponse
77from slack_sdk .errors import SlackApiError
8- from slack_sdk .oauth import AuthorizeUrlGenerator , OAuthStateCookieUtils , RedirectUriPageRenderer
8+ from slack_sdk .oauth import AuthorizeUrlGenerator , OAuthStateUtils , RedirectUriPageRenderer
99from slack_sdk .oauth .installation_store import InstallationStore , Installation
1010from slack_sdk .oauth .state_store import OAuthStateStore
1111from slack_sdk .web import WebClient , SlackResponse
@@ -21,8 +21,8 @@ def __init__(
2121
2222 installation_store : InstallationStore ,
2323 oauth_state_store : OAuthStateStore ,
24- oauth_state_cookie_name : str = OAuthStateCookieUtils .default_cookie_name ,
25- oauth_state_expiration_seconds : int = OAuthStateCookieUtils .default_expiration_seconds ,
24+ oauth_state_cookie_name : str = OAuthStateUtils .default_cookie_name ,
25+ oauth_state_expiration_seconds : int = OAuthStateUtils .default_expiration_seconds ,
2626
2727 client_id : str ,
2828 client_secret : str ,
@@ -42,7 +42,7 @@ def __init__(
4242 self .installation_store = installation_store
4343 self .oauth_state_store = oauth_state_store
4444 self .oauth_state_cookie_name = oauth_state_cookie_name
45- self .oauth_state_cookie_utils = OAuthStateCookieUtils (
45+ self .oauth_state_cookie_utils = OAuthStateUtils (
4646 cookie_name = oauth_state_cookie_name ,
4747 expiration_seconds = oauth_state_expiration_seconds ,
4848 )
@@ -88,7 +88,7 @@ def build_authorize_url_redirection(self, request: BoltRequest, state: str) -> B
8888 status = 302 ,
8989 headers = {
9090 "Location" : [self .authorize_url_generator .generate (state )],
91- "Set-Cookie" : [self .oauth_state_cookie_utils .build_creation_header (state )]
91+ "Set-Cookie" : [self .oauth_state_cookie_utils .build_set_cookie_for_new_state (state )]
9292 },
9393 )
9494
@@ -195,7 +195,7 @@ def build_callback_failure_response(
195195 headers = {
196196 "Content-Type" : "text/html; charset=utf-8" ,
197197 "Content-Length" : len (html ),
198- "Set-Cookie" : self .oauth_state_cookie_utils .build_deletion_header (),
198+ "Set-Cookie" : self .oauth_state_cookie_utils .build_set_cookie_for_deletion (),
199199 },
200200 body = html ,
201201 )
@@ -217,7 +217,7 @@ def build_callback_success_response(
217217 headers = {
218218 "Content-Type" : "text/html; charset=utf-8" ,
219219 "Content-Length" : len (html ),
220- "Set-Cookie" : self .oauth_state_cookie_utils .build_deletion_header (),
220+ "Set-Cookie" : self .oauth_state_cookie_utils .build_set_cookie_for_deletion (),
221221 },
222222 body = html ,
223223 )
0 commit comments