{"id":15323784,"url":"https://github.com/LeoBorai/http-auth-basic","last_synced_at":"2025-10-14T00:30:40.022Z","repository":{"id":46739222,"uuid":"291559073","full_name":"EstebanBorai/http-auth-basic","owner":"EstebanBorai","description":"HTTP Basic Authentication Scheme (RFC 7617 and RFC 2617 compilant, base64-encoded credentials) for Rust applications","archived":false,"fork":false,"pushed_at":"2024-07-28T02:36:05.000Z","size":45,"stargazers_count":10,"open_issues_count":0,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-22T20:06:53.256Z","etag":null,"topics":["auth","base64","basic","http","rust"],"latest_commit_sha":null,"homepage":"https://crates.io/crates/http-auth-basic","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EstebanBorai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-08-30T22:02:28.000Z","updated_at":"2024-10-18T06:42:26.000Z","dependencies_parsed_at":"2023-02-08T12:15:45.271Z","dependency_job_id":null,"html_url":"https://github.com/EstebanBorai/http-auth-basic","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstebanBorai%2Fhttp-auth-basic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstebanBorai%2Fhttp-auth-basic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstebanBorai%2Fhttp-auth-basic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EstebanBorai%2Fhttp-auth-basic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EstebanBorai","download_url":"https://codeload.github.com/EstebanBorai/http-auth-basic/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236422784,"owners_count":19146323,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["auth","base64","basic","http","rust"],"created_at":"2024-10-01T09:22:06.028Z","updated_at":"2025-10-14T00:30:34.757Z","avatar_url":"https://github.com/EstebanBorai.png","language":"Rust","readme":"\u003cdiv\u003e\n  \u003cdiv align=\"center\" style=\"display: block; text-align: center;\"\u003e\n    \u003cimg\n      src=\"https://camo.githubusercontent.com/734a3468bce992fbc3b729562d41c92f4912c99a/68747470733a2f2f7777772e727573742d6c616e672e6f72672f7374617469632f696d616765732f727573742d6c6f676f2d626c6b2e737667\"\n      height=\"120\"\n      width=\"120\"\n    /\u003e\n  \u003c/div\u003e\n  \u003ch1 align=\"center\"\u003ehttp-auth-basic\u003c/h1\u003e\n  \u003ch4 align=\"center\"\u003e\n    HTTP Basic Authentication Scheme (RFC 7617 and RFC 2617 compilant, base64-encoded credentials) for Rust applications\n  \u003c/h4\u003e\n\u003c/div\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n  [![Crates.io](https://img.shields.io/crates/v/http-auth-basic.svg)](https://crates.io/crates/http-auth-basic)\n  [![Documentation](https://docs.rs/http-auth-basic/badge.svg)](https://docs.rs/http-auth-basic)\n  ![Build](https://github.com/EstebanBorai/http-auth-basic/workflows/build/badge.svg)\n  ![Clippy](https://github.com/EstebanBorai/http-auth-basic/workflows/clippy/badge.svg)\n  ![Fmt](https://github.com/EstebanBorai/http-auth-basic/workflows/fmt/badge.svg)\n  ![Release](https://github.com/EstebanBorai/http-auth-basic/workflows/release/badge.svg)\n  ![Tests](https://github.com/EstebanBorai/http-auth-basic/workflows/tests/badge.svg)\n\n\u003c/div\u003e\n\n## Description\n\nThe \"Basic\" Hypertext Transfer Protocol (HTTP) authentication scheme, transmits credentials as user-id/password pairs, encoded using Base64.\n\n\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/EstebanBorai/http-auth-basic/main/assets/basic-auth-workflow.png\" /\u003e\n\u003c/div\u003e\n\nThe server will gather the credentials from the base64 encoded header value, and will validate them\nto authenticate the user in question.\n\nThis crate covers the credentials encoding and decoding. The `Credentials` struct provides two fields\n`user_id` and `password`, these are filled with they raw values.\n\n## Usage\n\nDecoding a basic authorization value and creating a `Credentials` struct\nfrom it\n\n```rust\nuse http_auth_basic::Credentials;\n\nlet auth_header_value = String::from(\"Basic dXNlcm5hbWU6cGFzc3dvcmQ=\");\nlet credentials = Credentials::from_header(auth_header_value).unwrap();\n\nassert_eq!(credentials.user_id, String::from(\"username\"));\nassert_eq!(credentials.password, String::from(\"password\"));\n```\n\nEncoding `Credentials` into a basic authorization header value.\n\n```rust\nuse http_auth_basic::Credentials;\n\nlet credentials = Credentials::new(\"username\", \"password\");\nlet credentials = credentials.as_http_header();\n\nassert_eq!(String::from(\"Basic dXNlcm5hbWU6cGFzc3dvcmQ=\"), credentials);\n```\n\n## Release\n\n```bash\ngit tag -a v0.1.0 -m \"Release Message\"\ngit push origin main --follow-tags\n```\n\n## Contributing\n\nEvery contribution to this project is welcome! Feel free to open a pull request or an issue.\n\n## References\n\n- [MDN The general HTTP Authentication Framework](https://developer.mozilla.org/en-US/docs/Web/HTTP/Authentication)\n- [RFC7617](https://tools.ietf.org/html/rfc7617)\n- [RFC2617](https://tools.ietf.org/html/rfc2617)\n\n## License\n\nDistributed under the terms of both the MIT license and the Apache License (Version 2.0)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeoBorai%2Fhttp-auth-basic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FLeoBorai%2Fhttp-auth-basic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FLeoBorai%2Fhttp-auth-basic/lists"}