Add a status/published field in a consumer

Created on 28 March 2024, 9 months ago
Updated 22 July 2024, 5 months 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
  • Pipeline finished with Success
    9 months 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 9 months ago
  • 🇧🇪Belgium gorkagr
  • Pipeline finished with Success
    9 months ago
    Total: 139s
    #131559
  • Pipeline finished with Success
    9 months ago
    Total: 144s
    #131786
  • Status changed to Needs work 8 months ago
  • Pipeline finished with Canceled
    8 months ago
    Total: 114s
    #136495
  • Pipeline finished with Success
    8 months 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 8 months ago
  • 🇧🇪Belgium gorkagr
  • 🇮🇳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.

  • First commit to issue fork.
  • Pipeline finished with Success
    5 months ago
    Total: 188s
    #231316
  • Pipeline finished with Canceled
    4 months ago
    Total: 249s
    #253945
  • Pipeline finished with Failed
    4 months ago
    Total: 460s
    #253949
Production build 0.71.5 2024