Skip to content

Commit

Permalink
VACMS-19551: Merge main
Browse files Browse the repository at this point in the history
  • Loading branch information
omahane committed Dec 3, 2024
2 parents 35edd1c + ec9d4f7 commit 5227993
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 2 deletions.
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -511,6 +511,9 @@
"drupal/schemata": {
"3190131 - Possibly unnecessary logging in SchemaFactory::create().": "patches/3190131-schemata-remove-logging-statement.patch"
},
"drupal/simplesamlphp_auth": {
"VAMCS-19923: add PIV car logging": "patches/VACMS-19923-simplesaml-attributes-error-logging.patch"
},
"drupal/social_media_links": {
"3044002 - Platform Name and Aria Label issue": "patches/3044002-platform-name-and-aria-label-issue.patch"
},
Expand Down
2 changes: 1 addition & 1 deletion composer.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "0b15e2c55775f308dbee05582a4e5d9a",
"content-hash": "52f39894774ce36637636fa09295e5bb",
"packages": [
{
"name": "asm89/stack-cors",
Expand Down
2 changes: 1 addition & 1 deletion config/sync/field.field.media.document.field_document.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ field_name: field_document
entity_type: media
bundle: document
label: Document
description: 'For PDFs, please make sure the text can be cleanly copied out of the file – simple formatting is best.'
description: 'For PDFs, please make sure that it has been made to be accessible. Accessibility standards for PDFs can be accessed in the <a href="/help/va-directive-6102#accessibility" target="_blank">VA Directive 6102 KB article''s Accessibility section (opens in a new tab)</a>.'
required: true
translatable: true
default_value: { }
Expand Down
38 changes: 38 additions & 0 deletions patches/VACMS-19923-simplesaml-attributes-error-logging.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
diff --git a/src/Service/SimplesamlphpAuthManager.php b/src/Service/SimplesamlphpAuthManager.php
--- a/src/Service/SimplesamlphpAuthManager.php (revision 31a968f6c4bb01dc920ddcbd09be109fce5d23fd)
+++ b/src/Service/SimplesamlphpAuthManager.php (date 1732899571161)
@@ -281,6 +281,35 @@
}
}

+ if (isset($attributes)) {
+ if (isset($attributes['firstName'])) {
+ $attributes['firstName'][0] = 'first name';
+ }
+ if (isset($attributes['lastName'])) {
+ $attributes['lastName'][0] = 'last name';
+ }
+ if (isset($attributes['adSamAccountName'])) {
+ $attributes['adSamAccountName'][0] = 'adSamAccountName';
+ }
+ if (isset($attributes['adUPN'][0])) {
+ $email = $attributes['adUPN'][0];
+ $user = user_load_by_mail($email);
+ if ($user) {
+ $attributes['adUPN'][0] = $user->id();
+ }
+ }
+ if (isset($attributes['adEmail'][0])) {
+ $email = $attributes['adEmail'][0];
+ $user = user_load_by_mail($email);
+ if ($user) {
+ $attributes['adEmail'][0] = $user->id();
+ }
+ }
+ \Drupal::logger('simplesamlphp_auth')->warning(print_r($attributes, TRUE));
+ }
+ else {
+ \Drupal::logger('simplesamlphp_auth')->warning('No simpleSAML attributes found');
+ }
throw new SimplesamlphpAttributeException(sprintf('Error in simplesamlphp_auth.module: no valid "%s" attribute set.', $attribute));
}

0 comments on commit 5227993

Please sign in to comment.