-
Notifications
You must be signed in to change notification settings - Fork 7
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
check operator version and provide correct presigned url #136
Merged
cody-constine-ttd
merged 68 commits into
main
from
wzh-uid2-3574-check-version-update-presignedurl
Dec 2, 2024
Merged
Changes from 56 commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
f979d8f
initial code
lizk886 cfdf76d
merge 3752
lizk886 5dc6553
tests
lizk886 cbcf4de
clean up
lizk886 ad72a7d
fix config
lizk886 60dcb27
update comapre version
lizk886 a64746d
remove snapshot
lizk886 0c81949
return boolean
lizk886 e18ea80
use regex
lizk886 395382c
clean up cpomments
lizk886 85c77e5
clean up
lizk886 78559a5
pull origion
lizk886 e64e6f8
fix spacing
lizk886 15b3719
refactor, put a new parameter in operator info
lizk886 c0cabe8
clean up
lizk886 0627853
operator test info
lizk886 2b9cddf
update tests
lizk886 eb338d2
update tests
lizk886 d4212e7
clean ups
lizk886 8e0af72
clean ups
lizk886 fd1ef07
defualt value if configs haven't updated yet
lizk886 b0e2de5
clean up
lizk886 53f2173
[CI Pipeline] Released Snapshot version: 2.17.1-alpha-35-SNAPSHOT
ea74e38
[CI Pipeline] Released Snapshot version: 2.17.2-alpha-36-SNAPSHOT
0baf8ae
[CI Pipeline] Released Snapshot version: 2.17.3-alpha-37-SNAPSHOT
b59c01a
update configs to extreme big number
lizk886 721bd5e
Merge branch 'wzh-uid2-3574-check-version-update-presignedurl' of git…
lizk886 deec8bb
[CI Pipeline] Released Snapshot version: 2.17.4-alpha-39-SNAPSHOT
c580126
add logger info to check which version it put
lizk886 99e7fe7
[CI Pipeline] Released Snapshot version: 2.17.5-alpha-40-SNAPSHOT
727e867
make config item private
lizk886 0e22d87
Merge branch 'wzh-uid2-3574-check-version-update-presignedurl' of git…
lizk886 69d5105
combine sperate printlns into 1 log
lizk886 6963e73
config issue in tests
lizk886 1e805dc
config issue in tests
lizk886 305a17d
config issue in tests
lizk886 92b99f9
config issue in tests
lizk886 4771169
revert keyacl and key
lizk886 bde5d9e
updated testcoreverticle
lizk886 1396829
update, if this is not working then I am not sure what to do
lizk886 349b3a3
update, if this is not working then I am not sure what to do
lizk886 4c7247a
test: deplaying the initialization of config number
lizk886 29c3bb9
update shared only for 3574
lizk886 d88c3e6
update comments
lizk886 d8df255
update client
lizk886 fe7c567
take in operator info
lizk886 4e5fd45
huge encryption benchmark
lizk886 b73ba5c
[CI Pipeline] Released Snapshot version: 2.17.6-alpha-42-SNAPSHOT
18324c1
update site, let it read encrpted/pliantext contents too
lizk886 23ebe65
Merge branch 'wzh-uid2-3574-check-version-update-presignedurl' of git…
lizk886 0f985c8
update site, let it read encrpted/pliantext contents too
lizk886 135867b
update site
lizk886 6050013
[CI Pipeline] Released Snapshot version: 2.17.7-alpha-43-SNAPSHOT
4aec426
[CI Pipeline] Released Snapshot version: 2.17.8-alpha-44-SNAPSHOT
3a5e135
make logger using debig version
lizk886 2b5736d
Added some more unit tests
cody-constine-ttd a063759
Small PR comments and upgraded to published shared version
cody-constine-ttd 24bb77e
Merged up to main
cody-constine-ttd 557b4f8
Finished merge
cody-constine-ttd 7bfd915
Finished rename
cody-constine-ttd 2cc2627
Merging up to main
cody-constine-ttd aba5976
Moving support version to 9999
cody-constine-ttd 3d9a2a3
[CI Pipeline] Released Snapshot version: 2.21.1-alpha-61-SNAPSHOT
43fd8fc
Merging up to main
cody-constine-ttd 1f4801f
[CI Pipeline] Released Snapshot version: 2.21.8-alpha-63-SNAPSHOT
fec327f
removing log message that will appear too much
cody-constine-ttd bd1fa80
updating operator version for workspace
cody-constine-ttd 9f2105e
Fix bad indent
cody-constine-ttd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
|
||
<groupId>com.uid2</groupId> | ||
<artifactId>uid2-core</artifactId> | ||
<version>2.17.0</version> | ||
<version>2.17.8-alpha-44-SNAPSHOT</version> | ||
|
||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
|
@@ -24,7 +24,7 @@ | |
<vertx.verticle>com.uid2.core.vertx.CoreVerticle</vertx.verticle> | ||
<launcher.class>io.vertx.core.Launcher</launcher.class> | ||
|
||
<uid2-shared.version>7.17.0</uid2-shared.version> | ||
<uid2-shared.version>7.17.8-alpha-140-SNAPSHOT</uid2-shared.version> | ||
<image.version>${project.version}</image.version> | ||
</properties> | ||
|
||
|
@@ -109,6 +109,11 @@ | |
<version>5.2.0</version> | ||
<scope>test</scope> | ||
</dependency> | ||
<dependency> | ||
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 does byte-buddy do? |
||
<groupId>net.bytebuddy</groupId> | ||
<artifactId>byte-buddy</artifactId> | ||
<version>1.14.17</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>io.vertx</groupId> | ||
<artifactId>vertx-micrometer-metrics</artifactId> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 3 additions & 1 deletion
4
src/main/java/com/uid2/core/service/ISiteMetadataProvider.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
package com.uid2.core.service; | ||
|
||
import com.uid2.core.util.OperatorInfo; | ||
|
||
public interface ISiteMetadataProvider { | ||
String getMetadata() throws Exception; | ||
String getMetadata(OperatorInfo info) throws Exception; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
src/main/resources/com.uid2.core/test/operators/operators.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,21 @@ | ||
[ | ||
{ | ||
"key": "UID2-O-L-999-dp9Dt0.JVoGpynN4J8nMA7FxmzsavxJa8B9H74y9xdEE=", | ||
"name": "Special", | ||
"contact": "Special", | ||
"protocol": "trusted", | ||
"created": 1701210253, | ||
"disabled": false, | ||
"roles": [ | ||
"OPERATOR", | ||
"OPTOUT" | ||
], | ||
"site_id": 999, | ||
"operator_type": "PUBLIC", | ||
"key_hash": "rTD7MpJn5/j4G6N+Ph659F4FGtiJy7MLNtfVA7XUdu6cYC9ok6EwGeI2upyDOvxvPkOCUn7HBKay8ubPQmRc0A==", | ||
"key_salt": "ZpqdDFksFeWx/ouPAoWi39TVuGrSGwijfCN4f0pAl2Y=", | ||
"key_id": "UID2-O-L-999-dp9Dt" | ||
}, | ||
{ | ||
"key": "test-partner-key", | ||
"name": "[email protected]", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
package com.uid2.core.util; | ||
|
||
import com.uid2.core.model.ConfigStore; | ||
import com.uid2.shared.auth.OperatorType; | ||
import io.vertx.core.json.JsonObject; | ||
import org.junit.jupiter.api.BeforeEach; | ||
import org.junit.jupiter.api.Test; | ||
import org.mockito.Mock; | ||
import org.mockito.MockitoAnnotations; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertEquals; | ||
import static org.mockito.Mockito.when; | ||
|
||
|
||
public class TestMetadataHelper { | ||
|
||
@Mock | ||
private OperatorInfo operatorInfo; | ||
|
||
@BeforeEach | ||
void setUp() { | ||
MockitoAnnotations.openMocks(this); | ||
ConfigStore.Global.load(new JsonObject().put("provide_private_site_data", true)); | ||
} | ||
|
||
@Test | ||
void testGetMetadataPathNameDecryptPublic() { | ||
when(operatorInfo.getOperatorType()).thenReturn(OperatorType.PUBLIC); | ||
when(operatorInfo.getSiteId()).thenReturn(42); | ||
when(operatorInfo.getSupportsEncryption()).thenReturn(true); | ||
|
||
String result = MetadataHelper.getMetadataPathName(operatorInfo, "s3://test-bucket/folder/"); | ||
assertEquals("s3://test-bucket/encrypted/42_public/folder", result); | ||
} | ||
|
||
@Test | ||
void testGetMetadataPathNameDecryptPrivate() { | ||
when(operatorInfo.getOperatorType()).thenReturn(OperatorType.PRIVATE); | ||
when(operatorInfo.getSiteId()).thenReturn(42); | ||
when(operatorInfo.getSupportsEncryption()).thenReturn(true); | ||
|
||
String result = MetadataHelper.getMetadataPathName(operatorInfo, "s3://test-bucket/folder/"); | ||
assertEquals("s3://test-bucket/encrypted/42_private/folder", result); | ||
} | ||
|
||
|
||
@Test | ||
void testGetMetadataPathNamePublic() { | ||
when(operatorInfo.getOperatorType()).thenReturn(OperatorType.PUBLIC); | ||
when(operatorInfo.getSiteId()).thenReturn(42); | ||
when(operatorInfo.getSupportsEncryption()).thenReturn(false); | ||
|
||
String result = MetadataHelper.getMetadataPathName(operatorInfo, "s3://test-bucket/folder/"); | ||
assertEquals("s3://test-bucket/folder", result); | ||
} | ||
|
||
|
||
@Test | ||
void testGetMetadataPathNamePrivate() { | ||
when(operatorInfo.getOperatorType()).thenReturn(OperatorType.PRIVATE); | ||
when(operatorInfo.getSiteId()).thenReturn(42); | ||
when(operatorInfo.getSupportsEncryption()).thenReturn(false); | ||
|
||
String result = MetadataHelper.getMetadataPathName(operatorInfo, "s3://test-bucket/folder/"); | ||
assertEquals("s3://test-bucket/site/42/folder", result); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 not forget to add this in the uid2-operator-deployment repo. Suggest you add that before you merge this