{"id":36665798,"url":"https://github.com/decodeproject/decidim-module-petitions","last_synced_at":"2026-01-12T10:33:36.903Z","repository":{"id":93372419,"uuid":"192990472","full_name":"DECODEproject/decidim-module-petitions","owner":"DECODEproject","description":"Decidim module to add functionality to work with DECODE petitions","archived":false,"fork":false,"pushed_at":"2019-11-13T07:22:41.000Z","size":1287,"stargazers_count":1,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-01-28T02:33:18.945Z","etag":null,"topics":["citizen-participation","decidim","decode","privacy-protection"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","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/DECODEproject.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-AGPLv3.txt","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":"2019-06-20T21:37:38.000Z","updated_at":"2021-11-29T20:04:16.000Z","dependencies_parsed_at":"2023-03-10T15:01:02.636Z","dependency_job_id":null,"html_url":"https://github.com/DECODEproject/decidim-module-petitions","commit_stats":{"total_commits":62,"total_committers":3,"mean_commits":"20.666666666666668","dds":0.5483870967741935,"last_synced_commit":"1dc8a5677732216053c6f7f843f2d92ba3cd642a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DECODEproject/decidim-module-petitions","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DECODEproject%2Fdecidim-module-petitions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DECODEproject%2Fdecidim-module-petitions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DECODEproject%2Fdecidim-module-petitions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DECODEproject%2Fdecidim-module-petitions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DECODEproject","download_url":"https://codeload.github.com/DECODEproject/decidim-module-petitions/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DECODEproject%2Fdecidim-module-petitions/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28338474,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["citizen-participation","decidim","decode","privacy-protection"],"created_at":"2026-01-12T10:33:36.830Z","updated_at":"2026-01-12T10:33:36.888Z","avatar_url":"https://github.com/DECODEproject.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# decidim-petitions\n\n[![Build Status](https://img.shields.io/circleci/project/github/DECODEproject/decidim-module-petitions/master.svg)](https://circleci.com/gh/DECODEproject/decidim-module-petitions)\n[![Coverage](https://img.shields.io/codeclimate/coverage/alabs/decidim-module-petitions.svg)](https://codeclimate.com/github/alabs/decidim-module-petitions)\n[![Maintainability](https://img.shields.io/codeclimate/maintainability/alabs/decidim-module-petitions.svg)](https://codeclimate.com/github/alabs/decidim-module-petitions)\n\nThis is the open-source repository for DDDC, based on [Decidim](https://github.com/decidim/decidim),\nimplementing the [DECODE](https://decodeproject.eu/) prototypes.\n\n## Installation\n\nAdd this line to your Gemfile:\n\n```ruby\n\ngem \"decidim-petitions\",\n    git: \"https://github.com/decodeproject/decidim-module-petitions\",\n\n```\n\nRun this commands:\n\n```bash\n\nbundle install\nrake decidim_petitions:install:migrations\nrake db:migrate\n```\n\nTo use this module you need to have at least running Credentials Issuer API and\nPetition API from DECODE project. To do so:\n\n- Head to Petitions configuration and specify the Cred. Issuer and Petitions API\n  URLs as well as user and passwords to interact with them.\n- Make sure the petition details are well configured ![](docs/decode-petitions-cog.png).\n\nThen you need to configure the petition with the associated data for the Mobile App.\nFor details, see [http://app.decodeproject.eu](http://app.decodeproject.eu).\n\n## Screenshots\n\n![](docs/decode-petitions-01.png)\n![](docs/decode-petitions-02.png)\n![](docs/decode-petitions-03.png)\n![](docs/decode-petitions-04.png)\n![](docs/decode-petitions-05.png)\n\n## Tests\n\nInstall [ChromeDriver](https://github.com/SeleniumHQ/selenium/wiki/ChromeDriver).\n\n```bash\nsudo apt-get install chromium-chromedriver\n```\n\nCreate test app and use rspec for running tests locally:\n\n```bash\nbundle exec rake test_app\nbundle exec rspec\n```\n\n## Documentation\n\n### JSON Schema and Attributes Authorization\n\nIt's important to configure some JSON data so it's consumed by the DECODE's APIs:\n\n## json_schema\n\nThis field adds information that any app wishing to interact with the site can use.\nFor the moment, it does no require anything beyond the fields specified below as\n\"mandatory\":\n\n- Name: Name with translations to identify the petition within the app\n- Provenance: Provenance that indicates where the credentials are from (what is\n  shown to the user). Must coincide with the credential issuer set up in the system.\n- Verification Input: Translations and names for the type of verification chosen\n  (see next section).\n\n```json\n{\n  \"mandatory\": [\n    {\n      \"name\": {\n        \"ca\": \"Credencial per participar\",\n        \"en\": \"Credential to participate\",\n        \"es\": \"Credencial para participar\"\n      },\n      \"provenance\": {\n        \"url\": \"https://credential-test.dyne.org\",\n        \"issuerName\": {\n          \"ca\": \"Gestor de credencials DECODE\",\n          \"en\": \"DECODE Credential Issuer\",\n          \"es\": \"Gestor de credenciales de DECODE\"\n        },\n        \"petitionsUrl\": \"https://petition-test.dyne.org\"\n      },\n      \"verificationInput\": [\n        {\n          \"id\": \"codes\",\n          \"name\": {\n            \"ca\": \"Codi\",\n            \"en\": \"Code\",\n            \"es\": \"Código\"\n          },\n          \"type\": \"string\"\n        }\n      ]\n    }\n  ]\n}\n```\n\n## json_attribute_info\n\nThis field defines the authorization codes that the credential issuer needs in\norder to issue certificates. In other words, it specifies the codes that allow\npeople to gain the right to participate in the support of a petition. Those codes\ncan be one-use (if the tick ```is reisuable``` is set to true) or multiple use\n(otherwise).\n\nIn the example below, the codes are defined as strings and codenamed \"codes\". For\nmore information, see please [the credential issuer documentation](https://credentials.decodeproject.eu/docs)\nor [the repository](https://github.com/DECODEproject/credential-issuer).\n\nWARNING: The first code is going to be used for Petitions API setup.\n\n```json\n\n[{\n    \"name\": \"codes\",\n    \"type\": \"str\",\n    \"value_set\": [\n      \"1234\",\n      \"a_password\"\n    ]\n}]\n```\n\n## json_attribute_info_optional\n\nThis field defines the optional info that can be attached to the credentials.\nThis is used in order to gather anonymous (aggregated) information on the demographics\nof the users that participate in the petitions.\n\nThe aggreated information is exposed on the endpoint of the credential issuer /stats.\n\n- The parametter \"k\" specifies the minimum number of entries needed for a value\n  to be shown for privacy reasons.\n- The name is the identifier that needs to be compatible with the DECODE Atlas\n  (see [APP repo](https://github.com/DECODEproject/decodev2/tree/master/docs)\n  for details)\n- The value set is the set of values (ranges) that the data accepts.\n\nAll those fields are not free, and must be compatible with the DECODE Atlas\nfile. The only option for the admin is to define the \"k\" security aggregation\nvalues.\n\n```json\n[\n  {\n    \"k\": 2,\n    \"name\": \"age\",\n    \"type\": \"str\",\n    \"value_set\": [\"0-19\", \"20-29\", \"30-39\", \"\u003e40\"]\n  },\n  {\n    \"k\": 2,\n    \"name\": \"gender\",\n    \"type\": \"str\",\n    \"value_set\": [\"F\", \"M\", \"O\"]\n  },\n  {\n    \"k\": 2,\n    \"name\": \"district\",\n    \"type\": \"str\",\n    \"value_set\": [\"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"10\"]\n  }\n]\n```\n\n## GraphQL\n\nTo consume some data from external services, you can do it on the GraphQL API:\n\n```graphql\n{\n    petition(id:\"1\") {\n        id,\n        title,\n        description,\n        author,\n        json_schema,\n        image,\n        credential_issuer_api_url,\n        petitions_api_url,\n        attribute_id\n    }\n}\n```\n\nAn example with curl:\n\n```bash\ncurl 'http://localhost:3000/api' \\\n    -H 'content-type: application/json' \\\n    --data '{\n      \"query\":\"{\n        petition(id:\\\"1\\\") {\n          id,\n          title,\n          description,\n          author,\n          json_schema,\n          image,\n          credential_issuer_api_url,\n          petitions_api_url,\n          attribute_id\n        }}\"\n      }'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodeproject%2Fdecidim-module-petitions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecodeproject%2Fdecidim-module-petitions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecodeproject%2Fdecidim-module-petitions/lists"}