Skip to content

Add solution for Challenge 5 by sahil1si18ec083#1571

Merged
github-actions[bot] merged 2 commits intoRezaSi:mainfrom
sahil1si18ec083:challenge-5-sahil1si18ec083
Apr 13, 2026
Merged

Add solution for Challenge 5 by sahil1si18ec083#1571
github-actions[bot] merged 2 commits intoRezaSi:mainfrom
sahil1si18ec083:challenge-5-sahil1si18ec083

Conversation

@sahil1si18ec083
Copy link
Copy Markdown
Contributor

Challenge 5 Solution

Submitted by: @sahil1si18ec083
Challenge: Challenge 5

Description

This PR contains my solution for Challenge 5.

Changes

  • Added solution file to challenge-5/submissions/sahil1si18ec083/solution-template.go

Testing

  • Solution passes all test cases
  • Code follows Go best practices

Thank you for reviewing my submission! 🚀

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 9, 2026

Walkthrough

A new Go HTTP server template is added with token-based authentication middleware. The implementation includes a hardcoded authentication constant, middleware that validates an X-Auth-Token header, two HTTP handlers for /hello and /secure routes, and a server setup function that applies the middleware to the secure endpoint.

Changes

Cohort / File(s) Summary
HTTP Server Template
challenge-5/submissions/sahil1si18ec083/solution-template.go
Added complete HTTP server scaffold with AuthMiddleware validating X-Auth-Token header against hardcoded validToken constant, helloHandler and secureHandler for unprotected and protected routes respectively, SetupServer function constructing the mux with routes, and main function entry point (with commented ListenAndServe).

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

Poem

🐰 A server takes shape with auth in place,
Token checks guard the secure space,
/hello hops free, /secure stands tall,
Middleware whispers "who goes there?" to all! 🔐

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately identifies that this PR adds a solution for Challenge 5 by a specific user, which directly matches the main change in the changeset.
Description check ✅ Passed The description is clearly related to the changeset, providing context about the challenge submission, the file path, and testing verification.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
challenge-5/submissions/sahil1si18ec083/solution-template.go (1)

15-19: Remove the stale TODO block in middleware.

This TODO is already fully implemented below, so keeping it can mislead future edits.


ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 8d6a2c94-a86d-40a8-824c-2cbb04bc9459

📥 Commits

Reviewing files that changed from the base of the PR and between 6a002af and 62b28a4.

📒 Files selected for processing (1)
  • challenge-5/submissions/sahil1si18ec083/solution-template.go

@github-actions github-actions Bot merged commit 932f889 into RezaSi:main Apr 13, 2026
6 checks passed
@github-actions
Copy link
Copy Markdown

🎉 Auto-merged!

This PR was automatically merged after 2 days with all checks passing.

Thank you for your contribution, @sahil1si18ec083!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants