Social Auth Nextcloud allows users to register and login to Drupal site with their Nextcloud account. It is based on social auth and social api projects. Also is the first module in social auth implementing the derivative plugin, so one can use various nextcloud accounts in different servers to be used as authentication in any drupal.

Project link

https://www.drupal.org/project/social_auth_nextcloud

Comments

aleix created an issue. See original summary.

shashank5563’s picture

Thank you for applying! Reviewers will review the project files, describing what needs to be changed.

Please read Review process for security advisory coverage: What to expect for more details and Security advisory coverage application checklist to understand what reviewers look for. Tips for ensuring a smooth review gives some hints for a smoother review.

To reviewers: Please read How to review security advisory coverage applications, What to cover in an application review, and Drupal.org security advisory coverage application workflow.

While this application is open, only the user who opened the application can make commits to the project used for the application.

Reviewers only describe what needs to be changed; they don't provide patches to fix what reported in a review.

avpaderno’s picture

Title: [4.0.0-rc1] Social auth nextcloud » [4.0.x] Social auth nextcloud
Issue summary: View changes
vinaymahale’s picture

Please fix PHPCS issues

FILE: /social_auth_nextcloud/README.md
---------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------------------------------------
 65 | WARNING | Line exceeds 80 characters; contains 93 characters
 90 | WARNING | Line exceeds 80 characters; contains 83 characters
---------------------------------------------------------------------------


FILE: /social_auth_nextcloud/src/Plugin/Network/NextcloudAuth.php
------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------
 28 | WARNING | Line exceeds 80 characters; contains 81 characters
------------------------------------------------------------------------------------------------------


FILE: /social_auth_nextcloud/social_auth_nextcloud.routing.yml
---------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------
 11 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------
vinaymahale’s picture

Status: Needs review » Needs work
aleix’s picture

Status: Needs work » Needs review

Thank's vinaymahale, CS changes applied but the plugin annotation in class /social_auth_nextcloud/src/Plugin/Network/NextcloudAuth.php.

vinaymahale’s picture

That's fine @aleix
Ran PHPCS tests. No other issues found! Lets wait for other reviewers.

shashank5563’s picture

@aleix , I have reviewed the changes, and they look fine to me.

Let’s wait for other reviewers to take a look and if everything goes fine, you will get the role.

hemangi.gokhale’s picture

Status: Needs review » Needs work

Automated Review

FILE: /var/www/html/web/modules/contrib/social_auth_nextcloud/tests/src/Functional/SocialAuthNextcloudTestBase.php
------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Url.
------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/contrib/social_auth_nextcloud/src/Plugin/Derivative/NextcloudInstance.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Plugin\Derivative\DeriverBase.
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/contrib/social_auth_nextcloud/src/Plugin/Derivative/DynamicLocalTasks.php
----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------------------
 6 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Component\Plugin\Derivative\DeriverBase.
----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------------------


FILE: /var/www/html/web/modules/contrib/social_auth_nextcloud/src/Plugin/Network/NextcloudAuth.php
--------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------
 28 | WARNING | Line exceeds 80 characters; contains 81 characters
--------------------------------------------------------------------------------------------------

Manual Review

  1. Comments for Exception Catching: Include comments explaining why you're catching specific exceptions. This provides context for future maintainers. For example:
    try {
        // Attempt to set the access token.
        $this->setAccessToken($this->client->getAccessToken('authorization_code', ['code' => $this->request->query->get('code')]));
      } catch (IdentityProviderException $e) {
        // Log an error message in case of an exception.
        $this->loggerFactory->get('social_auth_nextcloud')
          ->error('There was an error during authentication. Exception: ' . $e->getMessage());
      }
  2. Consistent Naming Convention: Keep your naming convention consistent. For instance, $configFactory is using camelCase, but other variables like $extra_scopes and $request_stack are using snake_case. Stick to one convention for variable naming throughout your codebase.
  3. Use Constants for Static values: Define static values like 'v2-federated' as constants to avoid duplication and provide reusability in the future.
vishal.kadam’s picture

FILE: social_auth_nextcloud.routing.yml

_permission: 'administer social api authentication'

'administer social api authentication' permission is not defined in the module.

hemangi.gokhale’s picture

@vishal.kadam, based on my understanding, this module relies on the social_auth module, which utilizes the administer social api authentication permission. Therefore, if the permission needs to be defined, it should be done through the social_auth module. However, note that my interpretation may not be entirely accurate.

vishal.kadam’s picture

Status: Needs work » Needs review

@Hemangi Gokhale Thanks for pointing it out.

This module relies on the social_auth module, which relies on the social_api module, where 'administer social api authentication' permission is defined.

So comment #10 is invalid, and there is no need to change anything.

hemangi.gokhale’s picture

Status: Needs review » Needs work

Cool, but @vishal.kadam, I think this module still needs work as per the review done at #9

aleix’s picture

Status: Needs work » Needs review

Hi again, Thank's for pointing out @Hemangi Gokhale .
I just have commited some of the proposals but the social_auth_nextcloud/src/Plugin/Network/NextcloudAuth.php:28 as this is a handler class annotation pointing to a class, I have no way to shorten it...

avpaderno’s picture

Assigned: Unassigned » avpaderno
Status: Needs review » Reviewed & tested by the community

Thank you for your contribution! I am going to update your account.

These are some recommended readings to help with excellent maintainership:

You can find more contributors chatting on the Slack #contribute channel. So, come hang out and stay involved.
Thank you, also, for your patience with the review process.
Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.

I thank all the reviewers.

avpaderno’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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