-
Notifications
You must be signed in to change notification settings - Fork 5
feat: add security identity management support #3
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| package com.coveo.pushapiclient; | ||
|
|
||
| import java.util.Map; | ||
|
|
||
| public class AliasMapping extends IdentityModel { | ||
| public String provider; | ||
|
|
||
| public AliasMapping(String provider, String name, SecurityIdentityType type, Map<String, String> additionalInfo) { | ||
| super(name, type, additionalInfo); | ||
| this.provider = provider; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,15 @@ | ||||||||||||||
| package com.coveo.pushapiclient; | ||||||||||||||
|
|
||||||||||||||
| import java.util.Map; | ||||||||||||||
|
|
||||||||||||||
| public class IdentityModel { | ||||||||||||||
| public Map<String, String> additionalInfo; | ||||||||||||||
| public String name; | ||||||||||||||
| public SecurityIdentityType type; | ||||||||||||||
|
Comment on lines
+6
to
+8
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After initializing those variables, you never change their values. You should therefore transcribe that behaviour semantically with the
Suggested change
|
||||||||||||||
|
|
||||||||||||||
| public IdentityModel(String name, SecurityIdentityType type, Map<String, String> additionalInfo) { | ||||||||||||||
| this.name = name; | ||||||||||||||
| this.type = type; | ||||||||||||||
| this.additionalInfo = additionalInfo; | ||||||||||||||
| } | ||||||||||||||
| } | ||||||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| package com.coveo.pushapiclient; | ||||||
|
|
||||||
| public class SecurityIdentityAliasModel extends SecurityIdentityModelBase { | ||||||
| public AliasMapping[] mappings; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After initializing the variable, you never change its values. You should therefore transcribe that behaviour semantically with the
Suggested change
|
||||||
|
|
||||||
| public SecurityIdentityAliasModel(AliasMapping[] mappings, IdentityModel identity, IdentityModel[] wellKnowns) { | ||||||
| super(identity, wellKnowns); | ||||||
| this.mappings = mappings; | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||
| package com.coveo.pushapiclient; | ||||||||||
|
|
||||||||||
| public class SecurityIdentityBatchConfig { | ||||||||||
| public String fileId; | ||||||||||
| public Long orderingId; | ||||||||||
|
Comment on lines
+4
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After initializing those variables, you never change their values. You should therefore transcribe that behaviour semantically with the
Suggested change
|
||||||||||
|
|
||||||||||
| public SecurityIdentityBatchConfig(String fileId, Long orderingId) { | ||||||||||
| this.fileId = fileId; | ||||||||||
| this.orderingId = orderingId; | ||||||||||
| } | ||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| package com.coveo.pushapiclient; | ||
|
|
||
| public class SecurityIdentityDelete { | ||
| public IdentityModel identity; | ||
|
|
||
| public SecurityIdentityDelete(IdentityModel identity) { | ||
| this.identity = identity; | ||
| } | ||
| } | ||
|
Comment on lines
+1
to
+9
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What's the goal of this class?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's just a data class. It is ultimately just serialized in JSON. Used for |
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||
| package com.coveo.pushapiclient; | ||||||||||
|
|
||||||||||
| public class SecurityIdentityDeleteOptions { | ||||||||||
| public Integer queueDelay; | ||||||||||
| public Long orderingId; | ||||||||||
|
Comment on lines
+4
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After initializing those variables, you never change their values. You should therefore transcribe that behaviour semantically with the
Suggested change
|
||||||||||
|
|
||||||||||
| public SecurityIdentityDeleteOptions(Integer queueDelay, Long orderingId) { | ||||||||||
| this.queueDelay = queueDelay; | ||||||||||
| this.orderingId = orderingId; | ||||||||||
| } | ||||||||||
| } | ||||||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| package com.coveo.pushapiclient; | ||||||
|
|
||||||
| public class SecurityIdentityModel extends SecurityIdentityModelBase { | ||||||
| public IdentityModel[] members; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After initializing the variable, you never change itsvalue. You should therefore transcribe that behaviour semantically with the final keyword. It can help the JVM and thus increase the performance.
Suggested change
|
||||||
|
|
||||||
| public SecurityIdentityModel(IdentityModel[] members, IdentityModel identity, IdentityModel[] wellKnowns) { | ||||||
| super(identity, wellKnowns); | ||||||
| this.members = members; | ||||||
| } | ||||||
| } | ||||||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,11 @@ | ||||||||||
| package com.coveo.pushapiclient; | ||||||||||
|
|
||||||||||
| public class SecurityIdentityModelBase { | ||||||||||
| public IdentityModel identity; | ||||||||||
| public IdentityModel[] wellKnowns; | ||||||||||
|
Comment on lines
+4
to
+5
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. After initializing those variables, you never change their values. You should therefore transcribe that behaviour semantically with the
Suggested change
|
||||||||||
|
|
||||||||||
| public SecurityIdentityModelBase(IdentityModel identity, IdentityModel[] wellKnowns) { | ||||||||||
| this.identity = identity; | ||||||||||
| this.wellKnowns = wellKnowns; | ||||||||||
| } | ||||||||||
| } | ||||||||||
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.
After initializing the variable, you never change the value. You should therefore transcribe that behaviour semantically with the
finalkeyword. It can help the JVM and thus increase the performance.