{"id":13410501,"url":"https://github.com/Componolit/jwx","last_synced_at":"2025-03-14T16:32:17.716Z","repository":{"id":107366160,"uuid":"131441120","full_name":"Componolit/jwx","owner":"Componolit","description":"JSON/JWK/JWS/JWT/Base64 library in SPARK","archived":false,"fork":false,"pushed_at":"2020-10-12T05:49:54.000Z","size":475,"stargazers_count":17,"open_issues_count":2,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-07-31T20:43:00.150Z","etag":null,"topics":["ada","base64","jose","json","json-web-signature","jwk","jws","jwt","jwt-authentication","jwt-token","spark"],"latest_commit_sha":null,"homepage":"","language":"Ada","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Componolit.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}},"created_at":"2018-04-28T20:14:54.000Z","updated_at":"2024-05-07T19:45:49.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4cbe45f-872c-439e-8f39-633367555dd3","html_url":"https://github.com/Componolit/jwx","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Componolit%2Fjwx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Componolit%2Fjwx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Componolit%2Fjwx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Componolit%2Fjwx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Componolit","download_url":"https://codeload.github.com/Componolit/jwx/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243610231,"owners_count":20318929,"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":["ada","base64","jose","json","json-web-signature","jwk","jws","jwt","jwt-authentication","jwt-token","spark"],"created_at":"2024-07-30T20:01:07.348Z","updated_at":"2025-03-14T16:32:17.271Z","avatar_url":"https://github.com/Componolit.png","language":"Ada","funding_links":[],"categories":["Libraries"],"sub_categories":["Format Readers and Writers","Format Readers, Writers and Checkers"],"readme":"![Build Status](https://github.com/Componolit/jwx/workflows/tests/badge.svg?branch=master)\n\nJWX is a library for handling [JSON](https://www.json.org/) data and more. It\nis implemented in the [SPARK](http://spark-2014.org) programming language and\nhas been proven to contain no runtime errors. As a result, JWX is particularly\nsuited for processing untrusted information.\n\nIn version 0.5.0 of JWX, parsing of Base64 (RFC 4648) data, JSON (RFC 8259)\ndocuments, JSON Web Keys (JWK, RFC 7517) and limited support for JSON Web\nSignatures (JWS, RFC 7515) and JSON Web Tokens (JWT, RFC 7519) is implemented.\nIn the future, JSON Web Encryption (JWE, RFC 7516) and potentially [JSON\nSchema](http://json-schema.org) is anticipated.\n\nJWX is available under the AGPLv3 license. For commercial licensing and support\nmail to jwx@componolit.com.\n\n# Examples\n\nAPI documentation is available [here](doc/api/index.html).\n\n## Parsing Base64 data\n\n```Ada\nwith Ada.Text_IO; use Ada.Text_IO;\nwith JWX.Util;\nwith JWX.Base64;\n\nprocedure B64 is\n   use JWX;\n   Len    : Natural;\n   Bytes  : Byte_Array (1..50);\n   Result : String (1..50);\nbegin\n   Base64.Decode (Encoded =\u003e \"Zm9vYmFy\", Length =\u003e Len, Result =\u003e Bytes);\n   if Len \u003e 0 then\n      Util.To_String (Bytes, Result);\n      Put_Line (Result (1 .. Len)); -- \"foobar\"\n   end if;\nend B64;\n```\n\n## Parsing JSON document\n\n```Ada\nwith Ada.Text_IO; use Ada.Text_IO;\nwith JWX.JSON;\n\nprocedure JSON is\n   Data : String := \" { \"\"precision\"\": \"\"zip\"\", \"\"Latitude\"\":  37.7668, \"\"Longitude\"\": -122.3959, \"\"Address\"\": \"\"\"\", \"\"City\"\": \"\"SAN FRANCISCO\"\", \"\"State\"\": \"\"CA\"\", \"\"Zip\"\": \"\"94107\"\", \"\"Country\"\": \"\"US\"\" }\";\n   package J is new JWX.JSON (Data);\n   use J;\n   Result : Index_Type;\n   Match : Match_Type;\nbegin\n   Parse (Match);\n   if Match = Match_OK and then Get_Kind = Kind_Object\n   then\n      Result := Query_Object (\"City\");\n      Put_Line (\"City: \" \u0026 Get_String (Result)); -- \"SAN FRANCISCO\"\n\n      Result := Query_Object (\"Latitude\");\n      Put_Line (\"Lat.: \" \u0026 Get_Real (Result)'Img); -- 37.7668\n   end if;\nend JSON;\n```\n\n## Validating a JSON web token\n\n```Ada\nwith Ada.Text_IO; use Ada.Text_IO;\nwith JWX.JWT; use JWX.JWT;\nwith JWX_Test_Utils;\n\nprocedure JWT is\n   Tmp  : String := JWX_Test_Utils.Read_File (\"tests/data/JWT_test_data.dat\");\n   Key  : String := JWX_Test_Utils.Read_File (\"tests/data/HTTP_auth_key.json\");\n   Data : String := Tmp (Tmp'First .. Tmp'Last - 1);\n   package J renames Standard.JWX.JWT;\n   Result : J.Result_Type;\nbegin\n   Result := J.Validate_Compact (Data     =\u003e Data,\n                                 Key_Data =\u003e Key,\n                                 Audience =\u003e \"4cCy0QeXkvjtHejID0lKzVioMfTmuXaM\",\n                                 Issuer   =\u003e \"https://cmpnlt-demo.eu.auth0.com/\",\n                                 Now      =\u003e 1528404620);\n   if Result = Result_OK then\n      Put_Line (\"Token is valid\");\n   end if;\nend JWT;\n```\n\n# Limitations\n\nThe following known limitations exist in JWX:\n\n* While absence of runtime errors has been proven, no formal analysis for the stack usage exists\n* Generation of Base64, JSON, JWS, JWT etc. is not supported (only validation)\n* Unicode is not supported\n* JWS and JWT only support HMAC-SHA256 (no other HMAC modes, RSA or ECDSA)\n* JWS JSON serialization is not supported (only JWS compact serialization)\n* Only the registered claims `iss`, `exp` and `aud` are supported\n* No scopes or custom claims are supported\n\n# Building\n\nCheck out JWX and build it:\n\n```\n$ git clone --recursive https://github.com/Componolit/jwx.git\n$ cd jwx\n$ make\n```\n\nTo build the test cases, AUnit must be in your project path. To build an run\nthe tests do:\n\n```\n$ make test\n```\n\n# License\n\nAGPLv3, see [LICENSE](LICENSE) file for details.\n\n# Contact\n\njwx@componolit.com or through the issue tracker at https://github.com/Componolit/jwx\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FComponolit%2Fjwx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FComponolit%2Fjwx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FComponolit%2Fjwx/lists"}