Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
C
Core
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 935
    • Issues 935
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Operations
    • Operations
    • Incidents
  • Analytics
    • Analytics
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
  • Development
  • Core
  • Issues
  • #2077

Closed
Open
Opened Oct 01, 2020 by totten@tottenOwner

Expose a REST end-point through standard routing

Overview

Provide a binding for CRM_Utils_REST in the conventional routing system.

Example use-case

  1. Create a D8 site
  2. Create user/contact and set their API key
  3. Access the rest end-point with their API key

Current behavior

  • There is a binding through the extern/rest.php.
  • There are tests for the REST contract in E2E_Extern_RestTest
  • The end-point is difficult to use/deploy in environments like D8.

Proposed behavior

  • There is another binding civicrm/api/rest which speaks the same protocol.
  • The RestTest hits both end-points (depending on what's valid/available for the given build).
  • References to the REST endpoint (eg RestTest and API Explorer) are constructed via CRM_Utils_System::externUrl('extern/rest')

Comments

  • This is an offshoot of drupal#7 (closed) and cloud-native#16
  • This sounds easier than it is.
  • There's a draft/WIP: https://github.com/civicrm/civicrm-core/pull/17952
  • The protocol's authentication-handler is tied into CRM_Utils_System::loadBootstrap(). This needs refactoring/reworking to apply to be valid in a standard route.
Edited Oct 01, 2020 by totten
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: dev/core#2077