Skip to content
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

added map struct for external ids #320

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

bsdworkin
Copy link
Collaborator

Description

Please provide a summary of the pull request and the issue it resolves. Please add necessary details, context, dependencies, explanation of when review is needed (see next section), etc.

Fix external ID handling

Resolves #239

Review Time Estimate

Please give your idea of how soon this pull request needs to be reviewed by selecting one of the options below. This can be based on the criticality of the issue at hand and/or other relevant factors.

  • Immediately
  • Within a week
  • When possible

Type of changes

Please select a relevant option:

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Other (any another change that does not fall in one of the above categories.)

Checklist:

Please select all applicable options:

  • I have signed the Rokwire Contributor License Agreement (CLA). (Any contributor who is not an employee of the University of Illinois whose official duties include contributing to the Rokwire software, or who is not paid by the Rokwire project, needs to sign the CLA before their contribution can be accepted.)
  • I have updated the CHANGELOG.
  • I have read the Contributor Guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • My change requires updating the documentation.
  • I have made necessary changes to the documentation.
  • I have added tests related to my changes.
  • My changes generate no new warnings.
  • New and existing unit tests pass locally with my changes.
  • Any dependent changes have been merged and published in downstream modules.

Copy link
Collaborator

@mdryankov mdryankov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm generally fine with this change, because it would open the platform for further external integrations. However supporting legacy (keeping the legacy external_id) state is always a painful process which at some point produces problems in the near future. I would like to keep such support away as much as possible unless we have rock solid reason for the oposit.

@shurwit plrease feel free to add anything if I miss something.

Comment on lines +5 to +15
ID *string `json:"id"` // membership id
GroupIDs []string `json:"group_ids"` // list of group ids
UserID *string `json:"user_id"` // core user id
UserIDs []string `json:"user_ids"` // core user ids
ExternalID *string `json:"external_id"` // core user external id
NetID *string `json:"net_id"` // core user net id
Name *string `json:"name"` // member's name
Statuses []string `json:"statuses"` // lest of membership statuses
Offset *int64 `json:"offset"` // result offset
Limit *int64 `json:"limit"` // result limit
ExternalIDs map[string]string `json:"external_ids` //Map of external ids
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we gonna support a map wih key value pairs for all external ids, then I would highly appriaciate to take out the legacy field and make a migration.

@@ -452,6 +453,7 @@ func (sa *Adapter) CreateGroup(clientID string, current *model.User, group *mode
castedMemberships = append(castedMemberships, membership)
}
} else if current != nil {
externalIDs := map[string]string{"netID": current.NetID, "externalID": current.ExternalID}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use under scores instead of camel names. Camel names are not wrong approach. The idea is just to keep common standard within the project.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also in this way of thoughts externalID is better to be renamed to uin, uiuc_uin if we gonna support more such attributes and external ids...

CC @shurwit

@@ -1122,6 +1123,7 @@ func (h *ApisHandler) CreateMember(clientID string, current *model.User, w http.
return
}

externalIDs := map[string]string{"netID": current.NetID, "externalID": current.ExternalID}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above/below

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Fix external ID handling
2 participants