{"id":51126706,"url":"https://github.com/adit019/secure-authz-service-cpp","last_synced_at":"2026-06-25T08:31:51.050Z","repository":{"id":318124324,"uuid":"1069542256","full_name":"adit019/secure-authz-service-cpp","owner":"adit019","description":"C++ authentication and authorization microservice using salted SHA-256.","archived":false,"fork":false,"pushed_at":"2025-10-05T08:40:19.000Z","size":6134,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-05T09:20:45.728Z","etag":null,"topics":["authentication","authorization","c-plus-plus","jwt","microservice","security","sha256","systems-programming"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adit019.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-04T06:07:47.000Z","updated_at":"2025-10-05T08:40:23.000Z","dependencies_parsed_at":"2025-10-09T00:16:11.765Z","dependency_job_id":null,"html_url":"https://github.com/adit019/secure-authz-service-cpp","commit_stats":null,"previous_names":["adit019/secure-authz-service-cpp"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/adit019/secure-authz-service-cpp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adit019%2Fsecure-authz-service-cpp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adit019%2Fsecure-authz-service-cpp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adit019%2Fsecure-authz-service-cpp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adit019%2Fsecure-authz-service-cpp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adit019","download_url":"https://codeload.github.com/adit019/secure-authz-service-cpp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adit019%2Fsecure-authz-service-cpp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34767542,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-25T02:00:05.521Z","response_time":101,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["authentication","authorization","c-plus-plus","jwt","microservice","security","sha256","systems-programming"],"created_at":"2026-06-25T08:31:49.545Z","updated_at":"2026-06-25T08:31:50.965Z","avatar_url":"https://github.com/adit019.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# 🔐 Secure Authentication \u0026 Authorization Service (C++17)\n\n[![CI](https://img.shields.io/github/actions/workflow/status/adit019/secure-authz-service-cpp/cmake.yml?branch=main)](https://github.com/adit019/secure-authz-service-cpp/actions)\n![C++](https://img.shields.io/badge/C%2B%2B-17-blue)\n![gdb](https://img.shields.io/badge/debug-gdb-informational)\n![valgrind](https://img.shields.io/badge/memcheck-valgrind-informational)\n\nA high-performance **identity service** showcasing **AuthN/AuthZ** patterns in modern C++:\n-  **Authentication** with salted **SHA-256** password hashes *(OpenSSL when available)*  \n-  **Authorization** via role checks (RBAC)  \n-  **SDL Threat Model** applied — mitigates **3 critical risks**  \n-  **GDB + Valgrind** verified; **500+ concurrent sessions** load-tested\n\n\u003e **License:** Proprietary. All rights reserved. See [LICENSE](LICENSE).\n\n---\n\n##  Architecture\n\n`\text\n Client CLI / Tests\n        │\n        ▼\n +---------------------+       +---------------------+\n | Authentication API  |       | Authorization API   |\n |  - salt generation  |       |  - role checks      |\n |  - SHA-256 hashing  |       |  - RBAC policy      |\n +----------+----------+       +----------+----------+\n            \\                         /\n             \\                       /\n              \\                     /\n               +---------+---------+\n                         |\n                 InMemoryUserStore\n                 (thread-safe map)\n Quick Start\nPrereqs\nCMake ≥ 3.16, C++17 compiler\n\n(Optional) OpenSSL headers/libs for real SHA-256\n\nUbuntu: sudo apt-get update \u0026\u0026 sudo apt-get install -y libssl-dev\n\nmacOS (brew): brew install openssl\n\n---\n\n##  Example Results\n\n###  Secure Authentication Flow\nDemonstrates salted SHA-256 hashing, user verification, and role-based access (RBAC) for “admin” users.\n\n![Authentication Flow](assets/sec.png)\n\n---\n\nBuild\nbash\nCopy code\ngit clone https://github.com/adit019/secure-authz-service-cpp.git\ncd secure-authz-service-cpp\ncmake -S . -B build -DUSE_OPENSSL=ON\ncmake --build build -j\nRun\nbash\nCopy code\n# Demo CLI (register/login/authorize)\n./build/auth_service\n\n# Unit tests\nctest --test-dir build --output-on-failure\n\n# Load test (600 sessions)\n./build/load_test\n⚙️ SDL Threat Model (Summary)\nCredential Theft (MITM / replay)\n\nMitigation: salted hashes, recommend TLS for transport.\n\nPrivilege Escalation\n\nMitigation: explicit RBAC checks per action; least privilege defaults.\n\nMemory Safety / UAF\n\nMitigation: C++17 RAII, thread-safe store, CI sanitizers/Valgrind guidance.\n\nSee [THREAT_MODEL.md](docs/THREAT_MODEL.md) for details.\n\n Debugging \u0026 Verification\ngdb: gdb --args ./build/auth_service → run → bt on crash\n\nValgrind (Linux): valgrind --leak-check=full ./build/unit_tests\n\nSanitizers: enable with -DCMAKE_CXX_FLAGS=\"-fsanitize=address,undefined -O1 -g\"\n\n Project Structure\nruby\nCopy code\n$ tree -L 2\n.\n├── CMakeLists.txt\n├── include/\n│   └── Auth.h\n├── src/\n│   ├── Auth.cpp\n│   ├── Hash.cpp\n│   └── main.cpp\n├── tests/\n│   └── test_auth.cpp\n├── tools/\n│   └── load_test.cpp\n├── docs/\n│   └── THREAT_MODEL.md\n└── .github/workflows/cmake.yml\n CI (GitHub Actions)\nBuild on Ubuntu with libssl-dev\n\nRun unit tests and load test\n\nArtifact: (optional) add later\n\n License\nCopyright © 2025 Adit Sharma.\nAll rights reserved. See [LICENSE](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadit019%2Fsecure-authz-service-cpp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadit019%2Fsecure-authz-service-cpp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadit019%2Fsecure-authz-service-cpp/lists"}