func mergeIdentityWithUserinfo()

in lib/translator/translator.go [72:154]


func mergeIdentityWithUserinfo(id *ga4gh.Identity, userinfo *ga4gh.Identity) {
	if len(id.Subject) == 0 {
		id.Subject = userinfo.Subject
	}
	if len(id.Issuer) == 0 {
		id.Issuer = userinfo.Issuer
	}
	if id.IssuedAt == 0 {
		id.IssuedAt = userinfo.IssuedAt
	}
	if id.NotBefore == 0 {
		id.NotBefore = userinfo.NotBefore
	}
	if id.Expiry == 0 {
		id.Expiry = userinfo.Expiry
	}
	if len(id.Scope) == 0 {
		id.Scope = userinfo.Scope
	}
	if len(id.Scp) == 0 {
		id.Scp = userinfo.Scp
	}
	if len(id.Audiences) == 0 {
		id.Audiences = userinfo.Audiences
	}
	if len(id.AuthorizedParty) == 0 {
		id.AuthorizedParty = userinfo.AuthorizedParty
	}
	if len(id.ID) == 0 {
		id.ID = userinfo.ID
	}
	if len(id.Nonce) == 0 {
		id.Nonce = userinfo.Nonce
	}
	if len(id.GA4GH) == 0 {
		id.GA4GH = userinfo.GA4GH
	}
	if len(id.IdentityProvider) == 0 {
		id.IdentityProvider = userinfo.IdentityProvider
	}
	if len(id.Identities) == 0 {
		id.Identities = userinfo.Identities
	}
	if len(id.Username) == 0 {
		id.Username = userinfo.Username
	}
	if len(id.Email) == 0 {
		id.Email = userinfo.Email
	}
	if len(id.Name) == 0 {
		id.Name = userinfo.Name
	}
	if len(id.Nickname) == 0 {
		id.Nickname = userinfo.Nickname
	}
	if len(id.GivenName) == 0 {
		id.GivenName = userinfo.GivenName
	}
	if len(id.FamilyName) == 0 {
		id.FamilyName = userinfo.FamilyName
	}
	if len(id.MiddleName) == 0 {
		id.MiddleName = userinfo.MiddleName
	}
	if len(id.ZoneInfo) == 0 {
		id.ZoneInfo = userinfo.ZoneInfo
	}
	if len(id.Locale) == 0 {
		id.Locale = userinfo.Locale
	}
	if len(id.Picture) == 0 {
		id.Picture = userinfo.Picture
	}
	if len(id.Profile) == 0 {
		id.Profile = userinfo.Profile
	}
	if len(id.Realm) == 0 {
		id.Realm = userinfo.Realm
	}
	if len(id.VisaJWTs) == 0 {
		id.VisaJWTs = userinfo.VisaJWTs
	}
}