Skip to content

Commit f7a2e19

Browse files
committed
remove duplicate bearer backend definition
Signed-off-by: Maia Iyer <maia.raj.iyer@gmail.com>
1 parent 37ed5e6 commit f7a2e19

1 file changed

Lines changed: 0 additions & 19 deletions

File tree

a2a/git_issue_agent/a2a_agent.py

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,6 @@
3232
logger = logging.getLogger(__name__)
3333
logging.basicConfig(level=settings.LOG_LEVEL, stream=sys.stdout, format='%(levelname)s: %(message)s')
3434

35-
class BearerAuthBackend(AuthenticationBackend):
36-
""" Very temporary demo to grab auth token and print it"""
37-
async def authenticate(self, conn):
38-
try:
39-
auth = conn.headers.get("authorization")
40-
if not auth or not auth.lower().startswith("bearer "):
41-
print("No bearer token provided")
42-
return
43-
token = auth.split(" ", 1)[1]
44-
print(f"TOKEN: {token}")
45-
46-
# Storing the token as the username - not a real life scenario - just demo-ing the passing of creds
47-
user = SimpleUser(token)
48-
return AuthCredentials(["authenticated"]), user
49-
except Exception as e:
50-
logger.error("Exception when attempting to obtain user token")
51-
logger.error(e)
52-
53-
5435
def get_agent_card(host: str, port: int):
5536
"""Returns the Agent Card for the AG2 Agent."""
5637
capabilities = AgentCapabilities(streaming=True)

0 commit comments

Comments
 (0)