{"id":23773891,"url":"https://github.com/kusanagi/katana-sdk-java8","last_synced_at":"2025-09-05T18:31:34.968Z","repository":{"id":57735759,"uuid":"66001027","full_name":"kusanagi/katana-sdk-java8","owner":"kusanagi","description":"Java 8 SDK for the KATANA Framework","archived":false,"fork":false,"pushed_at":"2018-06-01T09:17:18.000Z","size":3788,"stargazers_count":2,"open_issues_count":0,"forks_count":4,"subscribers_count":8,"default_branch":"master","last_synced_at":"2025-04-06T10:52:14.314Z","etag":null,"topics":["framework","java","java8","katana","kusanagi","sdk"],"latest_commit_sha":null,"homepage":"https://kusanagi.io","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kusanagi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-08-18T13:50:31.000Z","updated_at":"2018-07-10T05:38:20.000Z","dependencies_parsed_at":"2022-08-23T15:21:55.057Z","dependency_job_id":null,"html_url":"https://github.com/kusanagi/katana-sdk-java8","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/kusanagi/katana-sdk-java8","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kusanagi%2Fkatana-sdk-java8","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kusanagi%2Fkatana-sdk-java8/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kusanagi%2Fkatana-sdk-java8/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kusanagi%2Fkatana-sdk-java8/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kusanagi","download_url":"https://codeload.github.com/kusanagi/katana-sdk-java8/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kusanagi%2Fkatana-sdk-java8/sbom","scorecard":{"id":574139,"data":{"date":"2025-08-11","repo":{"name":"github.com/kusanagi/katana-sdk-java8","commit":"4a794a0035c5d860a0548aaab5a5f3623665310c"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.1,"checks":[{"name":"Code-Review","score":1,"reason":"Found 1/7 approved changesets -- score normalized to 1","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":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"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":"Binary-Artifacts","score":2,"reason":"binaries present in source code","details":["Warn: binary detected: gradle/wrapper/gradle-wrapper.jar:1","Warn: binary detected: lib/commons-lang3-3.5.jar:1","Warn: binary detected: lib/jackson-annotations-2.8.0.jar:1","Warn: binary detected: lib/jackson-core-2.8.1.jar:1","Warn: binary detected: lib/jackson-databind-2.8.5.jar:1","Warn: binary detected: lib/jackson-dataformat-msgpack-0.8.11.jar:1","Warn: binary detected: lib/jeromq-0.3.5.jar:1","Warn: binary detected: lib/msgpack-core-0.8.11.jar:1"],"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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":"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":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"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: MIT License: 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":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 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"}}]},"last_synced_at":"2025-08-20T17:11:59.541Z","repository_id":57735759,"created_at":"2025-08-20T17:11:59.541Z","updated_at":"2025-08-20T17:11:59.541Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273799071,"owners_count":25170308,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"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":["framework","java","java8","katana","kusanagi","sdk"],"created_at":"2025-01-01T05:46:13.699Z","updated_at":"2025-09-05T18:31:34.508Z","avatar_url":"https://github.com/kusanagi.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"KATANA SDK for Java 8\n=====================\n\n[![Build Status](https://travis-ci.org/kusanagi/katana-sdk-java8.svg?branch=master)](https://travis-ci.org/kusanagi/katana-sdk-java8)\n[![Coverage Status](https://coveralls.io/repos/github/kusanagi/katana-sdk-java8/badge.svg?branch=master)](https://coveralls.io/github/kusanagi/katana-sdk-java8?branch=master)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\nJava SDK to interface with the **KATANA**™ framework (https://kusanagi.io).\n\nRequirements\n------------\n\n* KATANA Framework 2.1\n* [JDK](http://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) 1.8\n* [libzmq](http://zeromq.org/intro:get-the-software) 4.1.5+\n\nInstallation\n------------\n\nTo install and use the Java SDK you'll need to first install the JDK 1.8. To do so using **apt** you can run the following from the command-line:\n\n```\n$ sudo apt-add-repository ppa:webupd8team/java\n$ sudo apt-get update\n$ sudo apt-get install oracle-java8-installer\n```\n\nThe SDK can then be built with either [Maven](https://maven.apache.org) or [Gradle](https://gradle.org).\n\nIf using **Maven**, add the following in your `pom.xml` file:\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003eio.kusanagi\u003c/groupId\u003e\n    \u003cartifactId\u003ekatana-sdk-java8\u003c/artifactId\u003e\n    \u003cversion\u003e2.1.0\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\nOr, if using **Gradle**, add the following in your `build.gradle` file:\n\n```gradle\ndependencies {\n    compile group: 'io.kusanagi', name: 'katana-sdk-java8', version: '2.1.0'\n}\n```\n\nGetting Started\n---------------\n\nThe **KATANA**™ SDK is fairly simple to use. We begin by first defining the model of our components using configuration files.\n\nHere we'll use `XML`, but the framework also supports both `JSON` and `YAML` formats.\n\nFirst, create a file named `middleware.xml`, with the following configuration:\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cmiddleware xmlns=\"urn:katana:middleware\" name=\"middleware_name\" version=\"middleware_version\" protocol=\"urn:katana:protocol:http\"\u003e\n    ...\n    \u003cengine runner=\"urn:katana:runner:java8\" path=\"middleware_file.jar\" single-process=true\u003e\n        \u003cvariable name=\"workers\" value=\"5\"/\u003e\n    ...\n\u003c/middleware\u003e\n```\n\nThen, create a file named `service.xml`, with the following configuration:\n\n```\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003cservice xmlns=\"urn:katana:service\" name=\"service_name\" version=\"service_version\"\u003e\n    ...\n    \u003cengine runner=\"urn:katana:runner:java8\" path=\"service_file.jar\" single-process=true\u003e\n        \u003cvariable name=\"workers\" value=\"5\"/\u003e\n    ...\n\u003c/service\u003e\n```\n\nNow, create a file named `middleware.class.java`, and add the following source code for the **Middleware**, which handles both a **Request** and a **Response**:\n\n```java\nimport io.kusanagi.katana.sdk.Middleware;\nimport io.kusanagi.katana.sdk.Callable;\nimport io.kusanagi.katana.sdk.Request;\nimport io.kusanagi.katana.sdk.Response;\n\npublic class Middleware {\n\n    public static void main(String[] args) {\n        Middleware middleware = new Middleware(args);\n        middleware.request(request -\u003e {\n                // your logic here\n                return request;\n            }\n        });\n        middleware.response(response -\u003e {\n                // your logic here\n                return response;\n            }\n        });\n        middleware.run();\n    }\n}\n```\n\nAnd also create a file named `service.class.java`, and add the following source code for the **Service**, which registers an action:\n\n```java\nimport io.kusanagi.katana.sdk.Service;\nimport io.kusanagi.katana.sdk.Callable;\nimport io.kusanagi.katana.sdk.Action;\n\npublic class Service {\n\n    public static void main(String[] args) {\n        Service service = new Service(args);\n        service.action(\"actionName\", action -\u003e {\n                // your logic here\n                return action;\n            }\n        });\n        service.run();\n    }\n}\n```\n\nExamples\n--------\n\nThe following example is a **Middleware** which translates HTTP requests to CRUD actions based on REST conventions:\n\n```java\npackage com.katana.example;\n\nimport io.kusanagi.katana.sdk.Middleware;\nimport io.kusanagi.katana.sdk.Callable;\nimport io.kusanagi.katana.sdk.Request;\n\nimport java.util.Iterator;\nimport java.util.Map;\n\npublic class Rest {\n\n    public static void main(String[] args) {\n        Middleware middleware = new Middleware(args);\n        middleware.request(request -\u003e {\n                // the URL format expected is \"/{version}/{service}/{extra}\"\n                String[] parts = request.getHttpRequest().getUrlPath().split(\"/\");\n                // set the Service version\n                request.setServiceVersion(parts[1]);\n                // set the Service name\n                request.setServiceName(parts[2]);\n                boolean hasExtraPath = parts.length == 4 \u0026\u0026 !parts[3].isEmpty();\n                String method = request.getHttpRequest().getMethod();\n                // resolve the Service action to call\n                switch (method) {\n                    case \"GET\":\n                        return request.setActionName(hasExtraPath ? \"read\" : \"list\");\n                    case \"POST\":\n                        return request.setActionName(\"create\");\n                    case \"PUT\":\n                        return request.setActionName(\"replace\");\n                    case \"PATCH\":\n                        return request.setActionName(\"update\");\n                    case \"DELETE\":\n                        return request.setActionName(\"delete\");\n                    default:\n                        return request.setActionName(actionName);\n                }\n            }\n        });\n        middleware.run();\n    }\n}\n```\n\nThe following example is a **Service** named \"users\", with a \"read\" action which retrieves a user from a `List` and returns the entity according to the `user_id` parameter:\n\n```java\npackage com.katana.example;\n\nimport io.kusanagi.katana.sdk.Service;\nimport io.kusanagi.katana.sdk.Callable;\nimport io.kusanagi.katana.sdk.Action;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\npublic class UserService {\n\n    public static void main(String[] args) {\n        Service service = new Service(args);\n        service.action(\"read\", action -\u003e {\n                // list of users, this would normally be a DB call\n                final List\u003cUser\u003e users = new ArrayList\u003c\u003e();\n                users.add(new User(1, \"James\"));\n                users.add(new User(2, \"Jeronimo\"));\n                users.add(new User(3, \"Fernando\"));\n                users.add(new User(4, \"Ricardo\"));\n                users.add(new User(5, \"Hugo\"));\n                // read the incoming \"id\" parameter\n                int userId = (Integer) action.getParam(\"id\").getValue();\n                User entity = null;\n                // find the user in the list\n                for (User user : users) {\n                    if (user.getId() == userId) {\n                        entity = user;\n                        break;\n                    }\n                }\n                if (entity == null) {\n                    return action.error(\"User does not exist\", 1, \"404 Not Found\");\n                }\n                action.setEntity(entity);\n                action.setLink(\"self\", \"/0.1.0/users/\" + userId);\n                return action;\n            }\n        });\n        service.run();\n    }\n}\n```\n\nDocumentation\n-------------\n\nSee the [API](https://app.kusanagi.io#katana/docs/sdk) for a technical reference of the SDK.\n\nFor help using the framework check the [documentation](https://app.kusanagi.io#katana/docs).\n\nSupport\n-------\n\nPlease first read our [contribution guidelines](https://app.kusanagi.io#katana/open-source/contributing).\n\n* [Requesting help](https://app.kusanagi.io#katana/open-source/help)\n* [Reporting a bug](https://app.kusanagi.io#katana/open-source/bug)\n* [Submitting a patch](https://app.kusanagi.io#katana/open-source/patch)\n* [Security issues](https://app.kusanagi.io#katana/open-source/security)\n\nWe use [milestones](https://github.com/kusanagi/katana-sdk-java8/milestones) to track upcoming releases inline with our [versioning](https://app.kusanagi.io#katana/docs/framework/versions) strategy, and as defined in our [roadmap](https://app.kusanagi.io#katana/docs/framework/roadmap).\n\nFor commercial support see the [solutions](https://kusanagi.io/solutions) available or [contact us](https://kusanagi.io/contact) for more information.\n\nContributing\n------------\n\nIf you'd like to know how you can help and support our Open Source efforts see the many ways to [get involved](https://app.kusanagi.io#katana/open-source).\n\nPlease also be sure to review our [community guidelines](https://app.kusanagi.io#katana/open-source/conduct).\n\nLicense\n-------\n\nCopyright 2016-2018 KUSANAGI S.L. (https://kusanagi.io). All rights reserved.\n\nKUSANAGI, the sword logo, KATANA and the \"K\" logo are trademarks and/or registered trademarks of KUSANAGI S.L. All other trademarks are property of their respective owners.\n\nLicensed under the [MIT License](https://app.kusanagi.io#katana/open-source/license). Redistributions of the source code included in this repository must retain the copyright notice found in each file.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkusanagi%2Fkatana-sdk-java8","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkusanagi%2Fkatana-sdk-java8","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkusanagi%2Fkatana-sdk-java8/lists"}