Overview

The CLI tool needs to be able to send HTTP requests to the relevant API endpoints, and be authenticated via the solution introduced in #3525572: Implement OAuth2 authentication for API endpoints related to code components.

→ See: #3525571: [Meta] CLI tool for code components

Proposed resolution

  1. Read the documentation on how to set up consumers produced in #3525572: Implement OAuth2 authentication for API endpoints related to code components.
  2. Implement reading the followings from environment variables or a .env file — e.g., using dotenv:
    1. Drupal site base URL
    2. Client ID
    3. Client secret
  3. Use an OAuth2 client library implemented in Node.js, make the CLI tool execute a single HTTP request to /api/v0/config/js_component, and simply print the results. Use the /oauth/token route to retrieve an access token.
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

balintbrews created an issue. See original summary.

balintbrews’s picture

Assigned: Unassigned » balintbrews
Status: Postponed » Active
wim leers’s picture

balintbrews’s picture

Title: Set up first authenticated request from CLI » Implement client credentials flow in CLI, centralize managing config

balintbrews’s picture

Assigned: balintbrews » hooroomoo
Status: Active » Needs review

  • balintbrews committed 48cb9b28 on 0.x
    Issue #3525579 by balintbrews, hooroomoo: Implement client credentials...

balintbrews’s picture

Assigned: hooroomoo » Unassigned
Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.