Equal compares two ExpectedGroups. The org id must be the same. If the group ID is set, it will be compared and take priority, ignoring the name value. So 2 groups with the same ID but different names will be considered equal.
(b ExpectedGroup)
| 335 | // name value. So 2 groups with the same ID but different names will be |
| 336 | // considered equal. |
| 337 | func (a ExpectedGroup) Equal(b ExpectedGroup) bool { |
| 338 | // Must match |
| 339 | if a.OrganizationID != b.OrganizationID { |
| 340 | return false |
| 341 | } |
| 342 | // Only the name or the name needs to be checked, priority is given to the ID. |
| 343 | if a.GroupID != nil && b.GroupID != nil { |
| 344 | return *a.GroupID == *b.GroupID |
| 345 | } |
| 346 | if a.GroupName != nil && b.GroupName != nil { |
| 347 | return *a.GroupName == *b.GroupName |
| 348 | } |
| 349 | |
| 350 | // If everything is nil, it is equal. Although a bit pointless |
| 351 | if a.GroupID == nil && b.GroupID == nil && |
| 352 | a.GroupName == nil && b.GroupName == nil { |
| 353 | return true |
| 354 | } |
| 355 | return false |
| 356 | } |
| 357 | |
| 358 | // ParseClaims will take the merged claims from the IDP and return the groups |
| 359 | // the user is expected to be a member of. The expected group can either be a |
no outgoing calls