| 91 | |
| 92 | |
| 93 | class FakeOAuthManager: |
| 94 | def __init__(self): |
| 95 | self.start_calls = 0 |
| 96 | self.callback_calls = [] |
| 97 | |
| 98 | def start_oauth(self): |
| 99 | self.start_calls += 1 |
| 100 | return OAuthStart( |
| 101 | auth_url=f"https://auth.example.test/flow/{self.start_calls}", |
| 102 | state=f"state-{self.start_calls}", |
| 103 | code_verifier=f"verifier-{self.start_calls}", |
| 104 | redirect_uri="http://localhost:1455/auth/callback", |
| 105 | ) |
| 106 | |
| 107 | def handle_callback(self, callback_url, expected_state, code_verifier): |
| 108 | self.callback_calls.append({ |
| 109 | "callback_url": callback_url, |
| 110 | "expected_state": expected_state, |
| 111 | "code_verifier": code_verifier, |
| 112 | }) |
| 113 | return { |
| 114 | "account_id": "acct-1", |
| 115 | "access_token": "access-1", |
| 116 | "refresh_token": "refresh-1", |
| 117 | "id_token": "id-1", |
| 118 | } |
| 119 | |
| 120 | |
| 121 | def _full_sentinel_token(flow: str, did: str, c_value: str = "server-token") -> str: |
no outgoing calls