Authentication Views
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The Authentication Views system in the Debug Arena platform provides the entry point for competitive teams. It manages team registration, secure login through credential verification, and session termination. This system is the primary "Gatekeeper" that ensures only authorized teams can access the debugging challenges within the Arena Dashboard.
This module leverages Flask Blueprints for routing, SQLAlchemy for team data persistence, and Werkzeug for secure password hashing. It establishes the team_id and team_name within the Flask session, which other modules like the violation logger and submission engine rely on to identify the active participant.
Sources: routes/auth_routes.py:1-5, app.py:40-41, README.md: core modules
System Architecture & Data Flow
The authentication system follows a standard MVC pattern where routes handle the logic, Jinja2 templates handle the presentation, and the Team model defines the data structure.
Authentication Process Flow
The following diagram illustrates the logic for registering a new team and subsequently logging into the arena.
Sources: routes/auth_routes.py:8-51
Key Components
Team Registration
The registration view handles team creation. It captures the team name, email, college, and password. To maintain security, passwords are never stored in plain text; the system utilizes pbkdf2:sha256 hashing.
Sources: routes/auth_routes.py:16-30, templates/register.html:10-25
| Field | Type | Constraint | Description |
|---|---|---|---|
team_name | String(50) | Unique, Not Null | The identifier for the team in the arena. |
email | String(120) | Unique, Not Null | Contact email for the team. |
college | String(100) | Not Null | The academic institution represented. |
password | String(255) | Not Null | Hashed credential for access. |
| Sources: models/team.py:6-14 |
Login and Session Management
The login view verifies credentials using check_password_hash. Upon successful validation, the team's identity is stored in the session.
Sources: routes/auth_routes.py:38-48
# routes/auth_routes.py:44-46
if team and check_password_hash(team.password, password):
session['team_id'] = team.id
session['team_name'] = team.team_name
return redirect(url_for('index'))
Logout Logic
Session termination is handled by session.clear(), which removes all team identification and violation state, effectively logging the user out and redirecting them to the home page.
Sources: routes/auth_routes.py:53-56
Integration with Security Gatekeeper
The authentication views are intrinsically linked to the platform's anti-cheat system. While the authentication views grant access, the arena_routes act as a second layer of defense by checking for violations once a session is established.
Conclusion
The Authentication Views provide the foundation for team identity within the Debug Arena. By combining secure registration via password hashing with session-based access control and integration into the violation monitoring system, it ensures that team progress is tracked accurately and securely throughout the competition.
Sources: README.md: Core Modules, routes/auth_routes.py