Add a status/published field in a consumer

Created on 28 March 2024, 22 days ago
Updated 4 April 2024, 15 days ago

Problem/Motivation

Right now, there is no way to invalidate (unpublish or set as inactive) a consumer, in case we want to do it.

By adding a 'status' field, the consumer will have that value and we can update its status. Then, if a consumer is inactive, a module that uses consumers (such as simple_oauth), can check its status and proceed to deny users access via that client/consumer.

Proposed resolution

  • Add the new field to this module.
  • Then update simple_oauth module to use this new feature

Remaining tasks

Push code
Review it
Do a new release

User interface changes

Just a new col in the list of consumers

API changes

-

Data model changes

-

Feature request
Status

Needs review

Version

1.0

Component

Code

Created by

🇧🇪Belgium gorkagr

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @gorkagr
  • Merge request !12Resolve #3436723 "Add a statuspublished" → (Open) created by gorkagr
  • Pipeline finished with Success
    22 days ago
    Total: 141s
    #131530
  • 🇧🇪Belgium gorkagr

    Hi!

    I think that is the code needed to create a new status field and set a value to existing consumers.
    I have also added a new column on the listBuilder as well.

    Best

  • Status changed to Needs review 22 days ago
  • Pipeline finished with Success
    22 days ago
    Total: 139s
    #131559
  • Pipeline finished with Success
    22 days ago
    Total: 144s
    #131786
  • Status changed to Needs work 16 days ago
  • Pipeline finished with Canceled
    16 days ago
    Total: 114s
    #136495
  • Pipeline finished with Success
    16 days ago
    Total: 145s
    #136499
  • 🇧🇪Belgium gorkagr

    HI

    I have reviewed the comments. In https://git.drupalcode.org/project/consumers/-/merge_requests/12/diffs?c... i c&p from the class to the installer and i did not notice the @label, but in the first commit was good, so i set directly consumer inside the t().

    Best

  • Status changed to Needs review 16 days ago
  • 🇮🇳India aman1248

    @gorkagr After applying patch #6, I encountered errors on my site. Consequently, I developed a new patch to address this issue, and it's currently functioning smoothly. The issue was successfully resolved after applying this patch.

  • 🇧🇪Belgium gorkagr

    Hi @amandeep_lnwebworks

    Patch in #8 seems incomplete and code missing, and the install() seems to not work as the info of the module is incomplete.
    My patch only works with the latest code from the dev branch, not if you have the latest release install (for that you need the rest of the patches in between this MR and the last release); If i see the image of the error, it looks like you have missing code as line 139 does not match with the changes i did.

    I will hide for the moment your patch just in case and will wait for a maintainer to take a look at both.

Production build https://api.contrib.social 0.62.1