Skip to content

Commit 53d5f24

Browse files
authored
Add annotations to examples/authentication (#941)
1 parent 9f91899 commit 53d5f24

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/authentication/generate_user_credentials.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#!/usr/bin/env python
22
# Copyright 2018 Google LLC
3+
4+
from typing import List, Dict
35
#
46
# Licensed under the Apache License, Version 2.0 (the "License");
57
# you may not use this file except in compliance with the License.
@@ -49,7 +51,7 @@
4951
_REDIRECT_URI = f"http://{_SERVER}:{_PORT}"
5052

5153

52-
def main(client_secrets_path, scopes):
54+
def main(client_secrets_path: str, scopes: List[str]) -> None:
5355
"""The main method, starts a basic server and initializes an auth request.
5456
5557
Args:
@@ -96,7 +98,7 @@ def main(client_secrets_path, scopes):
9698
)
9799

98100

99-
def get_authorization_code(passthrough_val):
101+
def get_authorization_code(passthrough_val: str) -> str:
100102
"""Opens a socket to handle a single HTTP request containing auth tokens.
101103
102104
Args:
@@ -145,7 +147,7 @@ def get_authorization_code(passthrough_val):
145147
return params.get("code")
146148

147149

148-
def parse_raw_query_params(data):
150+
def parse_raw_query_params(data: bytes) -> Dict[str, str]:
149151
"""Parses a raw HTTP request to extract its query params as a dict.
150152
151153
Note that this logic is likely irrelevant if you're building OAuth logic

0 commit comments

Comments
 (0)