-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: use aref when fieldmapping is empty #2
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is an interesting connector... :-) Please have a look at my comments and contact me if you have any questions
@@ -33,6 +33,7 @@ The following lifecycle actions are available: | |||
| Action | Description | | |||
| ------------------ | ------------------------------------ | | |||
| create.ps1 | PowerShell _create_ lifecycle action | | |||
| update.ps1 | PowerShell _update_ lifecycle action | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to describe the actions you're executing in each script. Especially since the create and update scripts only do correlation. I know we have a bit disclaimer describing this, but it wouldn't hurt to repeat that message?
$outputContext.AccountReference = $actionContext.Data.EmailAddress | ||
} | ||
$outputContext.success = $true | ||
$outputContext.AuditLogs.Add([PSCustomObject]@{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do something with previousData so the audit message is only shown when previousdata != data?
@@ -44,16 +44,22 @@ try { | |||
throw 'The account reference could not be found' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in the readme, you say: 'The $actionContext.References.Account is used when $actionContext.Data.EmailAddress is empty in the delete lifecycle action.' and in the mapping the aRef is will empty when there's no emailaddress. If there's a situation where the emailaddress is empty in aRef, the script will fail here, instead of getting the emailaddress from the mapping. The chance that this occurs is very slim, but i do think we should fix this.
I think we can fix this by throwing an error only when aRef and Data.EmailAddress are empty.
} | ||
$outputContext.success = $true | ||
$outputContext.AuditLogs.Add([PSCustomObject]@{ | ||
Action = 'CorrelateAccount' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We also say we correlate while Data.Emailaddress is empty?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think these comments apply to the create script too
No description provided.