The module currently implements at least one hook (hook_openid_connect_claim) but is lacking an openid_connect.api.php document.

I should be able to get to this soon.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

chrisrockwell created an issue. See original summary.

chrisrockwell’s picture

Status: Active » Needs work
FileSize
537 bytes

Here's a start

interX’s picture

Nice to see someone care about documentation ;)

Some remarks on your patch:

  • Your patch contains a hook documentation that does not exist (hook_openid_connect_claim)
  • Some minor coding standards issues (docblock @param on newline & extra description, newline at end of file).

These are the real hooks that someone can use :

$ grep -irn -e "moduleHandler()->invoke" -e "moduleHandler()->alter" -e "moduleHandler->alter" -e "alterInfo" *
openid_connect.module:312:  \Drupal::moduleHandler()->alter(__FUNCTION__, $properties_to_skip);
openid_connect.module:482:  \Drupal::moduleHandler()->invokeAll('openid_connect_post_authorize', array(
openid_connect.module:548:  \Drupal::moduleHandler()->invokeAll('openid_connect_post_authorize', array(
src/Claims.php:193:    $this->moduleHandler->alter('openid_connect_claims', $claims);
src/Plugin/OpenIDConnectClientManager.php:39:    $this->alterInfo('openid_connect_openid_connect_client_info');

Note: line numbers can differ from the -dev version.

The following hooks need to be described :

function hook_openid_connect_post_authorize($tokens, $account, $userinfo, $plugin_id) {}
function hook_openid_connect_claims_alter($claims) {}
function hook_openid_connect_openid_connect_client_info_alter(&$client_info) {}
function hook__openid_connect_user_properties_to_skip($properties_to_skip) {}

Note the last hook. Imho, this hook__openid_connect_user_properties_to_skip should be changed from

  \Drupal::moduleHandler()->alter(__FUNCTION__, $properties_to_skip);

to

  \Drupal::moduleHandler()->alter('openid_connect_user_properties_to_skip', $properties_to_skip);  

This might break current implementations, but I doubt it is used a lot. At least we get a clean alter hook.

chrisrockwell’s picture

Thanks for the feedback @interX. I'm actually using my_module_openid_connect_claims_alter - looks like I left off the 's' but the hook is there.

I'd love to come back to this and implement your feedback - I definitely wanted to get something started.

sanduhrs’s picture

Add some more details.

  • sanduhrs committed 712e883 on 8.x-1.x
    Issue #2912215 by chrisrockwell, sanduhrs: Create api documentation in...
sanduhrs’s picture

Status: Needs work » Fixed

Committed, thanks!

  • sanduhrs committed 84e3c65 on 8.x-1.x
    Issue #2912215 by sanduhrs: Create api documentation in openid_connect....

  • sanduhrs committed 42afca4 on 8.x-1.x
    Issue #2912215 by sanduhrs: Create api documentation in openid_connect....

Status: Fixed » Closed (fixed)

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