decidim 0.31.3 → 0.32.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (70) hide show
  1. checksums.yaml +4 -4
  2. data/decidim-core/lib/decidim/shakapacker/runner.rb +4 -4
  3. data/decidim-core/lib/decidim/shakapacker/shakapacker.yml +28 -3
  4. data/decidim.gemspec +21 -24
  5. data/docs/antora.yml +1 -1
  6. data/docs/modules/configure/pages/environment_variables.adoc +4 -26
  7. data/docs/modules/customize/pages/logic.adoc +31 -0
  8. data/docs/modules/develop/assets/images/maintainers-backports-checker.png +0 -0
  9. data/docs/modules/develop/pages/api/authentication.adoc +95 -0
  10. data/docs/modules/develop/pages/api/core-concepts.adoc +535 -0
  11. data/docs/modules/develop/pages/api/index.adoc +83 -0
  12. data/docs/modules/develop/pages/api/reference/components/debates/close.adoc +48 -0
  13. data/docs/modules/develop/pages/api/reference/components/debates/create.adoc +58 -0
  14. data/docs/modules/develop/pages/api/reference/components/debates/update.adoc +63 -0
  15. data/docs/modules/develop/pages/api/reference/components/debates.adoc +9 -0
  16. data/docs/modules/develop/pages/api/reference/components/meetings/close.adoc +48 -0
  17. data/docs/modules/develop/pages/api/reference/components/meetings/create.adoc +108 -0
  18. data/docs/modules/develop/pages/api/reference/components/meetings/update.adoc +95 -0
  19. data/docs/modules/develop/pages/api/reference/components/meetings/withdraw.adoc +36 -0
  20. data/docs/modules/develop/pages/api/reference/components/meetings.adoc +10 -0
  21. data/docs/modules/develop/pages/api/reference/components/proposals/answer.adoc +82 -0
  22. data/docs/modules/develop/pages/api/reference/components/proposals/create.adoc +78 -0
  23. data/docs/modules/develop/pages/api/reference/components/proposals/update.adoc +66 -0
  24. data/docs/modules/develop/pages/api/reference/components/proposals/vote.adoc +73 -0
  25. data/docs/modules/develop/pages/api/reference/components/proposals/withdraw.adoc +38 -0
  26. data/docs/modules/develop/pages/api/reference/components/proposals.adoc +14 -0
  27. data/docs/modules/develop/pages/api/reference/errors/attribute_validation_error.adoc +38 -0
  28. data/docs/modules/develop/pages/api/reference/errors/introspection_disabled_error.adoc +19 -0
  29. data/docs/modules/develop/pages/api/reference/errors/invalid_locale_error.adoc +30 -0
  30. data/docs/modules/develop/pages/api/reference/errors/locale_error.adoc +30 -0
  31. data/docs/modules/develop/pages/api/reference/errors/not_found.adoc +30 -0
  32. data/docs/modules/develop/pages/api/reference/errors/permission_not_set.adoc +46 -0
  33. data/docs/modules/develop/pages/api/reference/errors/recursion_limit_exceeded_error.adoc +19 -0
  34. data/docs/modules/develop/pages/api/reference/errors/too_many_aliases_error.adoc +23 -0
  35. data/docs/modules/develop/pages/api/reference/errors/unauthorized_field.adoc +30 -0
  36. data/docs/modules/develop/pages/api/reference/errors/unauthorized_mutation.adoc +30 -0
  37. data/docs/modules/develop/pages/api/reference/errors/unauthorized_object.adoc +30 -0
  38. data/docs/modules/develop/pages/api/reference/errors/validation_error.adoc +30 -0
  39. data/docs/modules/develop/pages/api/reference/errors.adoc +29 -0
  40. data/docs/modules/develop/pages/backports.adoc +100 -19
  41. data/docs/modules/develop/pages/c4_component.adoc +0 -3
  42. data/docs/modules/develop/pages/classes/models.adoc +0 -1
  43. data/docs/modules/develop/pages/components.adoc +67 -1
  44. data/docs/modules/develop/pages/machine_translations.adoc +1 -1
  45. data/docs/modules/develop/pages/maintainers/releases.adoc +34 -21
  46. data/docs/modules/develop/pages/maintainers/security.adoc +15 -1
  47. data/docs/modules/develop/partials/api/decidim_version.adoc +102 -0
  48. data/docs/modules/install/pages/manual.adoc +4 -3
  49. data/docs/modules/install/pages/update.adoc +7 -24
  50. data/docs/modules/install/partials/version_matrix.adoc +4 -8
  51. data/docs/modules/services/pages/activestorage.adoc +40 -0
  52. data/docs/modules/services/pages/aitools.adoc +0 -1
  53. data/docs/modules/services/pages/index.adoc +1 -0
  54. data/docs/modules/services/pages/machine_translation.adoc +139 -2
  55. data/docs/modules/services/pages/maps.adoc +42 -0
  56. data/lib/decidim/gem_manager.rb +19 -3
  57. data/lib/decidim/version.rb +1 -1
  58. data/lib/decidim.rb +0 -1
  59. data/package-lock.json +21070 -12671
  60. data/package.json +5 -4
  61. data/packages/browserslist-config/package.json +1 -1
  62. data/packages/core/package.json +28 -28
  63. data/packages/dev/package.json +2 -2
  64. data/packages/eslint-config/package.json +1 -1
  65. data/packages/prettier-config/package.json +1 -1
  66. data/packages/stylelint-config/package.json +1 -1
  67. data/packages/webpacker/package.json +13 -13
  68. data/packages/webpacker/src/override-config.js +1 -1
  69. metadata +73 -58
  70. data/docs/modules/develop/pages/api.adoc +0 -21
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c81ec7ce06cfd596a4048630dcbe51614df567955f5f759f51a7043bb108bf03
4
- data.tar.gz: e2fdf633e04a60e034171665997feee612f60bdd54d0713cd19c9609af4476f6
3
+ metadata.gz: 7e5393f2ef1590443933b8e7d02e6f675e179ea1bbfacaa61db56a28e4088064
4
+ data.tar.gz: 115b6aece646fecb40b20a576f17c0755a18eae63a6b9f99718ea50cd492b9fa
5
5
  SHA512:
6
- metadata.gz: d7112880034676d0541e49ff188689a441c2a967713087c29b6d015552d2538505d39f6d932953bd7393ce4f9a2308ecf4e7b760d916762cc362fbd2eea7b95b
7
- data.tar.gz: 29f0c8db6df198f8443d1070ef8424299b57d5884ae4b7200d30d2c40a5ad0bd64d88aee5c34e8d310ff7f0802136f815625a105f6bfb73070d8d6f0c5e6f063
6
+ metadata.gz: 18322a8bfd5c83a75bd74ece70dce9c9b2e7d48cd9668060d2366d38c57c45c9cf4da01e2ee59a1fa11c0127e85869a82ac838df0112db85e07ad0854b40452b
7
+ data.tar.gz: 4372ae457372cb04333414777d35b3ab34acb1cdfb7b104f5b56805d3c6d7334c11eeb5759829bed821185cc90036b0b03292bf63fa006fa14150e6340a3892a
@@ -7,15 +7,15 @@ module Decidim
7
7
  base.alias_method :original_initialize, :initialize
8
8
  base.send :private, :original_initialize
9
9
 
10
- base.define_method :initialize do |argv|
11
- decidim_initialize(argv)
12
- original_initialize(argv)
10
+ base.define_method :initialize do |argv, build_config = nil, bundler_override = nil|
11
+ decidim_initialize(argv, build_config, bundler_override)
12
+ original_initialize(argv, build_config, bundler_override)
13
13
  end
14
14
  end
15
15
 
16
16
  private
17
17
 
18
- def decidim_initialize(_argv)
18
+ def decidim_initialize(_argv, _build_config = nil, _bundler_override = nil)
19
19
  # Write runtime configuration for Tailwind
20
20
  # This method is called here because in Decidim CSS compilation is done via Webpack.
21
21
  # If CSS is decoupled from JS in the future, this call should be removed.
@@ -21,8 +21,12 @@ default: &default
21
21
  # Reload manifest.json on all requests so we reload latest compiled packs
22
22
  cache_manifest: false
23
23
 
24
- # Select loader to use, available options are 'babel' (default), 'swc' or 'esbuild'
25
- webpack_loader: 'esbuild'
24
+ # Select JavaScript transpiler to use
25
+ # Available options: 'swc' (default, 20x faster), 'babel', 'esbuild', or 'none'
26
+ # Use 'none' when providing a completely custom webpack configuration
27
+ # Note: When using rspack, swc is used automatically regardless of this setting
28
+ javascript_transpiler: 'esbuild'
29
+ assets_bundler: "webpack"
26
30
 
27
31
  # Set to true to enable check for matching versions of shakapacker gem and NPM package - will raise an error if there is a mismatch or wildcard versioning is used
28
32
  ensure_consistent_versioning: true
@@ -35,15 +39,36 @@ default: &default
35
39
  # https://webpack.js.org/guides/build-performance/#avoid-production-specific-tooling
36
40
  useContentHash: false
37
41
 
42
+ # Utilizing webpack-subresource-integrity plugin, will generate integrity hashes for all entries in manifest.json
43
+ # https://github.com/waysact/webpack-subresource-integrity/tree/main/webpack-subresource-integrity
44
+ integrity:
45
+ enabled: false
46
+ # Which cryptographic function(s) to use, for generating the integrity hash(es). Default sha-384. Other possible values sha256, sha512
47
+ hash_functions: [ "sha384" ]
48
+ # Default "anonymous". Other possible value "use-credentials"
49
+ # https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity#cross-origin_resource_sharing_and_subresource_integrity
50
+ cross_origin: "anonymous"
51
+
52
+ # HTTP 103 Early Hints support for faster asset loading
53
+ # Sends Link headers to browsers so they can preload assets while Rails is rendering
54
+ # See docs/early_hints_new_api.md for setup instructions and requirements
55
+ # https://api.rubyonrails.org/classes/ActionDispatch/Request.html#method-i-send_early_hints
56
+ early_hints:
57
+ enabled: false
58
+ # css: "preload" # 'preload' | 'prefetch' | 'none' - default: 'preload'
59
+ # js: "preload" # 'preload' | 'prefetch' | 'none' - default: 'preload'
60
+ # debug: false # Output early hints info as HTML comments for troubleshooting
61
+
38
62
  development:
39
63
  <<: *default
40
64
  compile: true
41
65
  compiler_strategy: mtime
42
66
  # Compile test packs to decidim decidim-packs folder
43
67
 
68
+ useContentHash: false
69
+
44
70
  # Reference: https://webpack.js.org/configuration/dev-server/
45
71
  dev_server:
46
- https: false
47
72
  host: localhost
48
73
  # Notice that we use a different port (to prevent blocking the default one) as
49
74
  # there will be at least two webpack servers running
data/decidim.gemspec CHANGED
@@ -2,11 +2,9 @@
2
2
 
3
3
  $LOAD_PATH.push File.expand_path("lib", __dir__)
4
4
 
5
- # Maintain your gem's version:
6
- require "decidim/version"
7
-
8
5
  Gem::Specification.new do |s|
9
- s.version = Decidim.version
6
+ version = "0.32.0.rc1"
7
+ s.version = version
10
8
  s.authors = ["Josep Jaume Rey Peroy", "Marc Riera Casals", "Oriol Gual Oliva"]
11
9
  s.email = ["josepjaume@gmail.com", "mrc2407@gmail.com", "oriolgual@gmail.com"]
12
10
  s.license = "AGPL-3.0-or-later"
@@ -18,7 +16,7 @@ Gem::Specification.new do |s|
18
16
  "homepage_uri" => "https://decidim.org",
19
17
  "source_code_uri" => "https://github.com/decidim/decidim"
20
18
  }
21
- s.required_ruby_version = "~> 3.3.0"
19
+ s.required_ruby_version = "~> 3.4.0"
22
20
 
23
21
  s.name = "decidim"
24
22
 
@@ -45,25 +43,24 @@ Gem::Specification.new do |s|
45
43
 
46
44
  s.require_paths = ["lib"]
47
45
 
48
- s.add_dependency "decidim-accountability", Decidim.version
49
- s.add_dependency "decidim-admin", Decidim.version
50
- s.add_dependency "decidim-api", Decidim.version
51
- s.add_dependency "decidim-assemblies", Decidim.version
52
- s.add_dependency "decidim-blogs", Decidim.version
53
- s.add_dependency "decidim-budgets", Decidim.version
54
- s.add_dependency "decidim-comments", Decidim.version
55
- s.add_dependency "decidim-core", Decidim.version
56
- s.add_dependency "decidim-debates", Decidim.version
57
- s.add_dependency "decidim-forms", Decidim.version
58
- s.add_dependency "decidim-generators", Decidim.version
59
- s.add_dependency "decidim-meetings", Decidim.version
60
- s.add_dependency "decidim-pages", Decidim.version
61
- s.add_dependency "decidim-participatory_processes", Decidim.version
62
- s.add_dependency "decidim-proposals", Decidim.version
63
- s.add_dependency "decidim-sortitions", Decidim.version
64
- s.add_dependency "decidim-surveys", Decidim.version
65
- s.add_dependency "decidim-system", Decidim.version
66
- s.add_dependency "decidim-verifications", Decidim.version
46
+ s.add_dependency "decidim-accountability", version
47
+ s.add_dependency "decidim-admin", version
48
+ s.add_dependency "decidim-api", version
49
+ s.add_dependency "decidim-assemblies", version
50
+ s.add_dependency "decidim-blogs", version
51
+ s.add_dependency "decidim-budgets", version
52
+ s.add_dependency "decidim-comments", version
53
+ s.add_dependency "decidim-core", version
54
+ s.add_dependency "decidim-debates", version
55
+ s.add_dependency "decidim-forms", version
56
+ s.add_dependency "decidim-generators", version
57
+ s.add_dependency "decidim-meetings", version
58
+ s.add_dependency "decidim-pages", version
59
+ s.add_dependency "decidim-participatory_processes", version
60
+ s.add_dependency "decidim-proposals", version
61
+ s.add_dependency "decidim-surveys", version
62
+ s.add_dependency "decidim-system", version
63
+ s.add_dependency "decidim-verifications", version
67
64
 
68
65
  s.add_development_dependency "bundler", "~> 2.2", ">= 2.2.18"
69
66
  s.add_development_dependency "rake", "~> 12.0"
data/docs/antora.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  name: en
2
2
  title: "Decidim Documentation"
3
- version: v0.31
3
+ version: v0.32
4
4
  asciidoc:
5
5
  attributes:
6
6
  page-lang: en@
@@ -175,28 +175,6 @@ Also, be sure to add the line `gem "aws-sdk-s3", require: false` in your Gemfile
175
175
  |true
176
176
  |No
177
177
 
178
- |*AZURE_STORAGE_ACCESS_KEY*
179
- |If STORAGE_PROVIDER is set to `azure`, define here your AZURE ACCESS KEY with permissions to access the container for the application. Needs to be encoded in Base64.
180
-
181
- Also, be sure to add the line `gem "azure-storage-blob", require: false` in your Gemfile.
182
- |
183
- |No
184
-
185
- |*AZURE_STORAGE_ACCOUNT_NAME*
186
- |If STORAGE_PROVIDER is set to `azure`, define here your AZURE ACCOUNT NAME with permissions to access the container for the application.
187
- |
188
- |No
189
-
190
- |*AZURE_CONTAINER*
191
- |If STORAGE_PROVIDER is set to `azure`, define here your AZURE CONTAINER used for uploading files and images.
192
- |
193
- |No
194
-
195
- |*AZURE_PUBLIC*
196
- |Whether the Azure assets to be public or not. Default is true, which means that no credential strings would be attached to your Azure stored assets, making it easier for components to be cached. If you set this to `false` you may have cache issues (like changing an image and not seeing the change immediately).
197
- |true
198
- |No
199
-
200
178
  |*GCS_PROJECT*
201
179
  |If STORAGE_PROVIDER is set to `gcs`, define here your GOOGLE CLOUD PROJECT with permissions to access the bucket for the application.
202
180
 
@@ -786,10 +764,10 @@ Read more about this at xref:services:pdf.adoc[PDF signing] service page.
786
764
  | false
787
765
  | No
788
766
 
789
- |API_SCHEMA_MAX_ALIASES
790
- |This Environment variable instructs Decidim how many aliases should be allowed in a GraphQL query
791
- |5
792
- |No
767
+ | API_SCHEMA_MAX_ALIASES
768
+ | This Environment variable instructs Decidim how many aliases should be allowed in a GraphQL query
769
+ | 5
770
+ | No
793
771
 
794
772
  |PROPOSALS_PARTICIPATORY_SPACE_HIGHLIGHTED_PROPOSALS_LIMIT
795
773
  |Number of proposals to be shown in blocks with highlighted content across different participatory spaces.
@@ -87,6 +87,37 @@ This applies to almost all classes you want to change in Decidim but controllers
87
87
  . Restart the server to apply these changes, as we changed the configuration of the application.
88
88
 
89
89
  [#explanation]
90
+
91
+ == Adding additional data to your form context.
92
+
93
+ By default, Decidim creates a context that is being passed to the form, containing 4 variables: `current_user`, `current_organization`, `current_participatory_space` and `current_component`.
94
+ When you need, you could add additional context to your form by using the following methods:
95
+
96
+ === As a form argument
97
+
98
+ [source,ruby]
99
+ ----
100
+ @form = form(Decidim::MyGem::MyForm).from_params(params, { my_extra: :context })
101
+ # or
102
+ @form = form(Decidim::MyGem::MyForm).from_model(model, { my_extra: :context })
103
+ ----
104
+
105
+ === As a concern
106
+
107
+ Sometimes, you may need to add the same parameter to all the forms in your controller, or you may need to override decidim default. You can achieve this by using a concern as follows:
108
+ [source,ruby]
109
+ ----
110
+ # frozen_string_literal: true
111
+ module MyOverride
112
+ def form_context
113
+ { my_extra: :context }
114
+ end
115
+ end
116
+
117
+ # and in an initializer
118
+ Decidim::MyGem::MyController.include(MyOverride)
119
+ ----
120
+
90
121
  == Extra notes
91
122
 
92
123
  The following step would help you find original source code:
@@ -0,0 +1,95 @@
1
+ = Authentication with the API
2
+
3
+ By default, the GraphQL API in Decidim is publically available for read-only operations and it can also be used by external applications to read data from Decidim. If you want to write data over the API, i.e. perform GraphQL mutations, you need first need to authenticate the API user to perform these operations. Otherwise, it is not possible to perform such operations as most such operations are performed as an actual user in Decidim.
4
+
5
+ More information regarding implementing the API authentication is available in the API documentation of your Decidim instance.
6
+
7
+ == Signing in to the API
8
+
9
+ In case you want to use the API as a sign in user to perform mutations representing a user in Decidim, you have two available options for such integrations through the system administration panel:
10
+
11
+ 1. Creating an OAuth application and implementing the OAuth authentication flow for the users of your application. Use this option for participant-facing applications where the participants represent themselves in Decidim through the API.
12
+ 2. Creating API credentials and signing in to the API with these credentials to perform the operations as a signed in machine user. Use this option for machine-to-machine automations where there is no real end user interacting with Decidim.
13
+
14
+ If you only want to test the GraphQL queries as a signed in user, you can use the normal Decidim authentication functionality to sign in and then use the GraphiQL IDE to perform these queries as a signed in user.
15
+
16
+ == OAuth flow for participant-facing applications
17
+
18
+ Participant-facing applications where the participants need to interact with Decidim through GraphQL mutations can be integrated using OAuth applications. In order to configure such integration capability from the system administration panel, create a new OAuth application and provide the necessary details for your integration. Note that the "application type" for such applications would typically be "Public". For more information regarding the application types, refer to https://datatracker.ietf.org/doc/html/rfc6749#section-2.1[RFC 6749 Section 2.1. (OAuth client types)].
19
+
20
+ In order to use the OAuth access tokens to represent the user through the API, please select the following scopes as "Available" scopes for the application:
21
+
22
+ * `user` - Authenticated users have the ability to represent a logged in user in Decidim
23
+ * `api:read` - Authenticated users have the ability to read data from the API
24
+ * `api:write` - Authenticated users have the ability to write data through the API (in case your external application needs to perform mutations over the API on behalf of the user)
25
+
26
+ Once configured, you can now use any OAuth authentication library to perform the OAuth authentication flow with your application users and receive an access token to utilize the Decidim API representing the signed in user. Please note that with public OAuth clients especially (and recommended also for confidential clients), you have to use https://datatracker.ietf.org/doc/html/rfc7636[PKCE] with the authorization flow.
27
+
28
+ Once the OAuth application is created, you can authenticate against it with the following steps:
29
+
30
+ 1. Send the user to perform an OAuth authorization request at Decidim with the required API scopes (`user`, `api:read` and `api:write` if you want to perform mutations over the API). Along with the authorization request, also send the additional parameters required by PKCE (`code_challenge` and `code_challenge_method`).
31
+ 2. Receive an OAuth authorization code back to your application's configured redirect URI.
32
+ 3. Utilizing the received authorization code, request an OAuth access token from the OAuth token endpoint. Along with the token request, also send the additional parameter required by PKCE `code_verifier`.
33
+ 4. The issued token is a JSON Web Token (JWT) when the authorization request contains the defined scopes. This token can be now used to represent the user in further calls to the API by passing the token with its type (`Bearer`) within the HTTP Authorization header with the request to the API.
34
+
35
+ When doing the requests to the API, you also need to pass the OAuth client ID within the `X-Jwt-Aud` header of the requests in order for the token to be recognized as a valid token for the issued client. Passing the bearer token to the `Authorization` header and the OAuth client ID to the `X-Jwt-Aud` header, you can send the following HTTP request to the API to validate that the token works and the user is recognized as signed in:
36
+
37
+ ```http
38
+ POST /api HTTP/1.1
39
+ Accept: application/json
40
+ Authorization: Bearer token
41
+ Content-Length: 53
42
+ Content-Type: application/json
43
+ Host: DOMAIN
44
+ X-Jwt-Aud: OAUTH_CLIENT_ID
45
+
46
+ {"query":"{ session { user { id name nickname } } }"}
47
+ ```
48
+
49
+ You should see the user details in the response in case the token is valid and you have configured the API correctly. If the response does not contain the user details, please refer to the Decidim configuration documentation.
50
+
51
+ Once the interaction with the API is completed, it is recommended to revoke the tokens, which is similar to the user signing out of the application. This can be done utilizing the OAuth revocation endpoint provided by Decidim. After the token is revoked, it is no longer valid and the user has to perform a re-authorization the next time they want to utilize the API.
52
+
53
+ In case you need tokens with a longer life span, you can either look into the Decidim documentation to extend the validity period of the access tokens or enable refresh tokens for the OAuth application when configuring it. However, note that tokens with longer lifespan can weaken the security of your system and make your application users vulnerable to security threats. Such use cases should be carefully planned and the security concerns should be addressed seriously.
54
+
55
+ == API credentials flow for machine-to-machine automations
56
+
57
+ The API credentials represent an administrative user in Decidim that performs administrative tasks on behalf of the end users. This type of integration flows should never live on devices that the participants have access to. These types of integrations are meant for different types of automations, such as transferring proposal answers or meeting reports back to Decidim from an external system automatically, e.g. once a day.
58
+
59
+ Note that these credentials are highly sensitive and have elevated permissions, so take good care of the system security where you are planning to store these credentials. If these credentials end up in participants' hands, the whole system is compromised and no longer secure. You should always primarily create OAuth integrations where the end users will manually perform the authorization for the application to perform actions on behalf of them.
60
+
61
+ Once you have validated that this is the correct way for your integration to operate, you can create the API credentials from the system administration panel. You will receive an API key and API secret after creating the credentials. These credentials should be also manually rotated on a regular basis to prevent unauthorized access to the system with these credentials in case they are leaked. The credentials have to be manually rotated in order to prevent external applications breaking because they cannot rotate the credentials themselves and they are typically statically configured for these applications.
62
+
63
+ Given you have issued the API key and API secret, you can now send a sign in request to the API using these credentials as follows:
64
+
65
+ ```bash
66
+ curl -s -i -H "Content-type: application/x-www-form-urlencoded" \
67
+ -d "api_user[key]=PASTE_API_KEY_HERE" \
68
+ -d "api_user[secret]=PASTE_API_SECRET_HERE" \
69
+ -X POST https://DOMAIN/api/sign_in | grep 'Authorization' | cut -d ' ' -f2-
70
+ ```
71
+
72
+ After running this command, you should see the following string in the console, where `token` is replaced with the access token:
73
+
74
+ ```bash
75
+ Bearer token
76
+ ```
77
+
78
+ This string is passed to the following requests within the HTTP `Authorization` header to represent the user during API calls. You can use the following example query to test it out and confirm that signing in works as expected:
79
+
80
+ ```bash
81
+ curl -w "\n" -H "Content-Type: application/json" \
82
+ -H "Authorization: Bearer token" \
83
+ -d '{"query":"{ session { user { id name nickname } } }"}' \
84
+ -X POST https://DOMAIN/api
85
+ ```
86
+
87
+ You should see the user details in the response in case the token is valid and you have configured the API correctly. If the response does not contain the user details, please refer to the Decidim configuration documentation.
88
+
89
+ Once the API interaction is done, you should always make an HTTP DELETE request to `/api/sign_out` with the same token in order to revoke the token from further access as follows:
90
+
91
+ ```bash
92
+ curl -s -o /dev/null -w "HTTP %{http_code}\n" \
93
+ -H "Authorization: Bearer token" \
94
+ -X DELETE http://DOMAIN/api/sign_out
95
+ ```