{"id":15211395,"url":"https://github.com/innoq/spring-cookie","last_synced_at":"2026-03-07T19:31:25.479Z","repository":{"id":57725265,"uuid":"138010809","full_name":"innoq/spring-cookie","owner":"innoq","description":"Some components for Spring MVC that use cookies instead of a HTTP session.","archived":false,"fork":false,"pushed_at":"2026-03-03T08:17:53.000Z","size":395,"stargazers_count":5,"open_issues_count":4,"forks_count":2,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-03-03T11:54:45.474Z","etag":null,"topics":["cookie","cookies","spring","spring-mvc","springframework","springmvc"],"latest_commit_sha":null,"homepage":null,"language":"Java","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/innoq.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-06-20T09:33:41.000Z","updated_at":"2026-03-03T08:17:55.000Z","dependencies_parsed_at":"2024-01-15T15:56:55.964Z","dependency_job_id":"f1699cd9-7461-45b4-bb80-8223f5f5ed5f","html_url":"https://github.com/innoq/spring-cookie","commit_stats":{"total_commits":182,"total_committers":3,"mean_commits":"60.666666666666664","dds":0.4560439560439561,"last_synced_commit":"c915de493f028c5dcec6dd8a13a76cbae153d949"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/innoq/spring-cookie","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoq%2Fspring-cookie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoq%2Fspring-cookie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoq%2Fspring-cookie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoq%2Fspring-cookie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/innoq","download_url":"https://codeload.github.com/innoq/spring-cookie/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/innoq%2Fspring-cookie/sbom","scorecard":{"id":489226,"data":{"date":"2025-08-11","repo":{"name":"github.com/innoq/spring-cookie","commit":"b26ba8304a2fd55b04edc6dd972799cdb1212af0"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.9,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":10,"reason":"12 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 1/12 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/innoq/spring-cookie/main.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/innoq/spring-cookie/main.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/main.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/innoq/spring-cookie/main.yml/main?enable=pin","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 third-party GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":8,"reason":"4 out of the last 4 releases have a total of 4 signed artifacts.","details":["Info: signed release artifact: spring-cookie-1.2.0-javadoc.jar.asc: https://github.com/innoq/spring-cookie/releases/tag/v1.2.0","Info: signed release artifact: spring-cookie-1.1.0-javadoc.jar.asc: https://github.com/innoq/spring-cookie/releases/tag/v1.1.0","Info: signed release artifact: spring-cookie-1.0.0-javadoc.jar.asc: https://github.com/innoq/spring-cookie/releases/tag/v1.0.0","Info: signed release artifact: spring-cookie-0.1.0-javadoc.jar.asc: https://github.com/innoq/spring-cookie/releases/tag/v0.1.0","Warn: release artifact v1.2.0 does not have provenance: https://api.github.com/repos/innoq/spring-cookie/releases/218737397","Warn: release artifact v1.1.0 does not have provenance: https://api.github.com/repos/innoq/spring-cookie/releases/217664779","Warn: release artifact v1.0.0 does not have provenance: https://api.github.com/repos/innoq/spring-cookie/releases/217665944","Warn: release artifact v0.1.0 does not have provenance: https://api.github.com/repos/innoq/spring-cookie/releases/217667287"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 19 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":8,"reason":"2 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-4wp7-92pw-q264","Warn: Project is vulnerable to: GHSA-6r3c-xf4w-jxjm"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-19T18:37:16.665Z","repository_id":57725265,"created_at":"2025-08-19T18:37:16.665Z","updated_at":"2025-08-19T18:37:16.665Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30227787,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T19:01:10.287Z","status":"ssl_error","status_checked_at":"2026-03-07T18:59:58.103Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["cookie","cookies","spring","spring-mvc","springframework","springmvc"],"created_at":"2024-09-28T08:40:28.514Z","updated_at":"2026-03-07T19:31:25.442Z","avatar_url":"https://github.com/innoq.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spring Cookie\n*- Come to the dark side, we have cookies*\n\n[![Maven Central](https://maven-badges.sml.io/sonatype-central/com.innoq/spring-cookie/badge.svg?version=1.2.0)](https://maven-badges.sml.io/sonatype-central/com.innoq/spring-cookie)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://www.apache.org/licenses/LICENSE-2.0)\n[![Open Issues](https://img.shields.io/github/issues/innoq/spring-cookie.svg)](https://github.com/innoq/spring-cookie/issues)\n[![Build Status](https://github.com/innoq/spring-cookie/actions/workflows/main.yml/badge.svg)](https://github.com/innoq/spring-cookie/actions/workflows/main.yml)\n[![Code Coverage](https://codecov.io/gh/innoq/spring-cookie/branch/main/graph/badge.svg)](https://codecov.io/gh/innoq/spring-cookie)\n\nSome components for\n[Spring MVC](https://docs.spring.io/spring/docs/current/spring-framework-reference/web.html)\nthat use cookies instead of a HTTP session.\n\n\n## Features\n\n- [CookieFlashMapManager](./src/main/java/com/innoq/spring/cookie/flash/CookieFlashMapManager.java)\n\n  A cookie based [FlashMapManager](https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/servlet/FlashMapManager.html)\n  implementation that can be used with different\n  [serialization](./src/main/java/com/innoq/spring/cookie/flash/FlashMapListCodec.java)\n  and [signing](./src/main/java/com/innoq/spring/cookie/security/CookieValueSigner.java)\n  implementations.\n\n  By default a [Jackson](https://github.com/FasterXML/jackson) based\n  [JSON implementation](./src/main/java/com/innoq/spring/cookie/flash/codec/jackson/JacksonFlashMapListCodec.java)\n  for serialization and\n  [HMAC implementation](./src/main/java/com/innoq/spring/cookie/security/HmacCookieValueSigner.java)\n  for signing is provided.\n\n\n## Quick Start\n\nDownload library through Maven:\n\n```xml\n\u003cdependency\u003e\n  \u003cgroupId\u003ecom.innoq\u003c/groupId\u003e\n  \u003cartifactId\u003espring-cookie\u003c/artifactId\u003e\n  \u003cversion\u003e1.2.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n### 1. Register as a Spring Bean\n\nTo enable cookie-based Flash attributes, register the `CookieFlashMapManager` as a Spring `@Bean`. You can customize the codec and signing mechanism:\n\n```java\n@Configuration\npublic class FlashAttributeStrategy {\n\n  @Bean\n  public CookieFlashMapManager cookieFlashMapManager() {\n    return new CookieFlashMapManager(\n      JacksonFlashMapListCodec.create(),             // JSON serialization\n      CookieValueSigner.hmacSha512(secretKeyBytes),  // Strong cookie signing\n      \"flash\"                                        // Name of the cookie\n    );\n  }\n}\n```\n\nMake sure to replace `secretKeyBytes` with a proper 64-byte key for HMAC-SHA-256 signing.\n\n### 2. Usage in your application\n\nThis is a typical POST-to-GET redirect pattern: after a POST request performs an action, the user is redirected to a GET endpoint that displays a result message.\n\n```java\n@PostMapping(\"/send-message\")\npublic String updateChangeRequestStatus(final RedirectAttributes redirectAttributes) {\n    final String message = sendMessage()\n        ? \"Okay, your message was submitted.\"\n        : \"Sending your message failed.\";\n\n    redirectAttributes.addFlashAttribute(\"message\", message);\n    return \"redirect:/messages\";\n}\n\n@GetMapping(\"/messages\")\n@ResponseBody\npublic String showMessage(@ModelAttribute(\"message\") String message) {\n    return message;\n}\n```\n\nThe message is transferred via an HTTP cookie rather than session storage – making it suitable for stateless environments or APIs.\n\n## Security Considerations\n\nSpring Cookie stores serialized data directly in HTTP cookies. While this enables stateless architectures, it also introduces potential attack surfaces. To ensure safe use in production environments, follow these best practices:\n\n### 1. Use a Strong Secret Key\n\nThe HMAC key should be **at least 256 bits (32 bytes)**, preferably **512 bits (64 bytes)** in length:\n\n```java\nKeyGenerator keyGen = KeyGenerator.getInstance(\"HmacSHA256\");\nkeyGen.init(512);\nbyte[] key = keyGen.generateKey().getEncoded();\n```\n\nStore and manage this key securely, ideally via environment variables or a vault.\n\n### 2. Avoid Storing Sensitive Information\n\nEven signed cookies are visible to the client. Do not store personal data, tokens, or confidential information in flash attributes.\n\nOK: status messages like `\"Saved successfully.\"`.\n\n*Avoid:* user IDs, emails, access rights, etc.\n\n## Release History\n\nSee [CHANGELOG.md](./CHANGELOG.md)\n\n\n## Code of Conduct\n\n[Contributor Code of Conduct](./CODE_OF_CONDUCT.md). By participating in this\nproject you agree to abide by its terms.\n\n\n## License\n\nSpring Cookie is Open Source software released under the\n[Apache 2.0 license](http://www.apache.org/licenses/LICENSE-2.0.html).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnoq%2Fspring-cookie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finnoq%2Fspring-cookie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finnoq%2Fspring-cookie/lists"}