Skip to content
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.

Commit

Permalink
Merge pull request #1047 from emosbaugh/serialized-entitlements-in-me…
Browse files Browse the repository at this point in the history
…tadata

Add serialized entitlements to release metadata
  • Loading branch information
emosbaugh authored Aug 22, 2019
2 parents fa5275c + 51ec26e commit 44a7223
Show file tree
Hide file tree
Showing 28 changed files with 28 additions and 26 deletions.
2 changes: 1 addition & 1 deletion integration/base/amazon-eks/expected/.ship/state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"v1": {
"config": {},
"contentSHA": "960dc0fcd154b339becd8838f9cc82d743f91c9b8b75ac6a80a4f58d3ad5b9fa",
"contentSHA": "bc7239400a3ffad5db48aac3f04ef23e6d8c65934e0c43c747b79b8841c490af",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/basic-stateless/expected/.ship/state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"v1": {
"config": {},
"contentSHA": "fb986fb5dcf5506efdec7a0516d75223d0e716cbd222af586dbbc05f609c484d",
"contentSHA": "3b20281c1e73d8d854316d4d74fc3af7675deab50679663566873f147726a11f",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/basic/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"config": {
"test_option": "abc123_test-option-value"
},
"contentSHA": "fb986fb5dcf5506efdec7a0516d75223d0e716cbd222af586dbbc05f609c484d",
"contentSHA": "3b20281c1e73d8d854316d4d74fc3af7675deab50679663566873f147726a11f",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"t2_option": "abc123_abc123",
"t3_option": "abc123_abc123 + abc123"
},
"contentSHA": "2b8259057c1312333450132fd5523a4f59139986c6c7371aaa39256bfb67c481",
"contentSHA": "d0d40cd4e897c8e2bec41669630b3033635e30b0acacb43c9676b0e7daa7ebf3",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/config-chain/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"t2_option": "abc123_abc123",
"t3_option": "abc123_abc123 + abc123"
},
"contentSHA": "2b8259057c1312333450132fd5523a4f59139986c6c7371aaa39256bfb67c481",
"contentSHA": "d0d40cd4e897c8e2bec41669630b3033635e30b0acacb43c9676b0e7daa7ebf3",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/default-values/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"namespace": "Alpha",
"scheduler": ""
},
"contentSHA": "9a75d307334cf7257c2728da93803caa336ea17b020dfa4977764bf1ac77e02a",
"contentSHA": "3227ff33ca66ceb1088335d11c62b628516870611c550330449da08cc4c9d8ba",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/docker-layer/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"config": {
"option": "value"
},
"contentSHA": "0ce5283c45d34248870963d0bdb7a7a2708ab4d3f7d7dc018f43513187832f70",
"contentSHA": "8764659df64cdeb83d13528d96ebe39414c8e0ec9c5bdc2ef0b1829d3957057a",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/docker/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"config": {
"test_option": "abc123_test-option-value"
},
"contentSHA": "651dd752112cbb0248deec91814121add82b9a042bfdd8b1450a4281fb681962",
"contentSHA": "8b264700d9195e35bdc95332279dccddc9a173510103be203c25f9bde1ca7f27",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/helm-nginx/expected/.ship/state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"v1": {
"config": {},
"contentSHA": "2dcfb7d9685eddde588f5ae1f9282a7b85e89860f030ae9ee08d914f3c8accf8",
"contentSHA": "144732da22781575a5368e9c50107d0f442aade5f9c84aa539ea372e436fdadb",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
2 changes: 1 addition & 1 deletion integration/base/web/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"methodType": "GET",
"resourceURL": "https://raw.githubusercontent.com/replicatedhq/test-charts/5bf016aac1786cb74c678c3419bb8623f0388f8d/web-asset/web-asset"
},
"contentSHA": "d0d955a1d3e5a2775b86f2e585252dc581f449b87a86aaf80f6428c039fe49d0",
"contentSHA": "23d3d4d0f99ade2e646c26822d67dcde9d814de3b92a398648d25ea61a55df48",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"v1": {
"config": {},
"upstream": "__upstream__",
"contentSHA": "8ceb6285ff8617f85cb61078fdd05c1096ed1996d2698a40cde1ca1333ff0344",
"contentSHA": "3536a785cb227012537376c3d299c96dc28a8c3ffe13d1486fdb0caffa7b09bc",
"metadata": {
"applicationType": "replicated.app",
"customerID": "__customerID__",
Expand Down
2 changes: 1 addition & 1 deletion integration/init_app/basic/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"v1": {
"config": {},
"upstream": "__upstream__",
"contentSHA": "674dfc6dbef7422277ad215e875f978f9c1d5d51429e1e231e461c3cee0954cb",
"contentSHA": "aafa722a828058d1da1eee0ee2f449533b9ddff13534ea94760fd177ab79e864",
"metadata": {
"applicationType": "replicated.app",
"customerID": "__customerID__",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"arch": "amd64"
}
},
"contentSHA": "780274fa1a9c10eae29416fc89d12d986afe189ee44037f5c9288126c22ac612"
"contentSHA": "86448f75e9c4bdf955bbfc594e86308449ec5118472db1d8ee6d8039f3c40881"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"sequence": 0,
"version": "0.0.1"
},
"contentSHA": "96bfc890d1966679e4d00c85b24f2afc53e1b2edc48fa975f014aa26d88b7eeb"
"contentSHA": "7ecf2846a73c305b14b1bb2ef080ae62a92736561d7a2eaeaf1eef49749f0a6a"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@
"sequence": 0,
"version": "1.0.0-SNAPSHOT"
},
"contentSHA": "f81b240e101fe229913a23cc3fc0ad59583ecd88711e280f5cd1971020249458"
"contentSHA": "e440ab14be5fead6c7f01efd0b24b9a1db2c809467dbeb314f81dcdeb8553ca7"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"option": "abc123"
},
"upstream": "__upstream__",
"contentSHA": "6c76198ecbf868cf6968d5c8e047424ccd7952a99b13b6da65c4edb78a0a7b6d",
"contentSHA": "1525f4ea74e654c3d6a021e2ded45e28b07164c5a2ef56a831047ef730c42a60",
"metadata": {
"applicationType": "replicated.app",
"customerID": "__customerID__",
Expand Down
2 changes: 1 addition & 1 deletion integration/init_app/helm-github/expected/.ship/state.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"v1": {
"config": {},
"contentSHA": "deaf3417dc3eb72f3d2bd7cf7434153cc555e8609e5e48ccb28795b39e2e5d87",
"contentSHA": "d47ebd26011bd04c77946884c93a7ec98bee02108ef164424c05cd9095199f7b",
"releaseName": "integration-replicated-app-helm-github",
"upstream": "__upstream__",
"metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"v1": {
"config": {},
"upstream": "__upstream__",
"contentSHA": "bddc8932888aeedf0ed046eea44b93df6a7a5552e0bdea74e406789dd3c85c9b",
"contentSHA": "ffb4e54d56ff40765aad683612a5dd1dab8d899458092ec19fcfe473d85a3566",
"metadata": {
"applicationType": "replicated.app",
"customerID": "__customerID__",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"buildTime": "0001-01-01T00:00:00Z",
"dependencies": {}
},
"contentSHA": "c1e6486e6e3c2c4e49dac714aa8c151a024765575e20a8348541cf0833c70114"
"contentSHA": "21e1e1d408b05347ce52dd19915f6ac607d67f4afd7f69f7bdaac49a5c9a4a23"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"last_updated": "0001-01-01T00:00:00Z",
"customer_id": ""
},
"serialized": "{\"entitlements\":[],\"meta\":{\"customerID\":\"CKk--APIp5SkXA0Z5os1hne8Sr_McDmI\",\"lastUpdated\":\"0001-01-01T00:00:00Z\"}}",
"signature": "eVlVacoh3aPSx+EvhmD+B8vG3QicsaWkJ+9vcFReB2xRgPtNgedfQkS7bmJxNwCHZlcOXX/m1io5IkFFXPdW4mXvIRO/5p6xJWFj/icU1iHOBPYf6Q2pEC9+ylXAj8upyPPGGJc+MN5X83Sxk/JumRJPMCNoykwgixkai7NtiZgEjvyfMLPZhYwZ5MBNEv6CJ5NCCw7JO1Ga8G6CDa6E3NLsFJLLLcYUQO+7+hDb9IMxkynHJCoazJ1587fVUgeZ1QLt+mWdJoILn+ioDH4TJ0XZMWvLdRDoV6JTugs1O3O9qh3sMu5C2fow0i3Cnr+K8DsWDpazXTBQzd2ZIuUFf02CgCEF+0M/o9DMbpocePjmHufxZXcEl3jv8rMv5wa6civwRA9W8dbv+eepMf4ngcUP/hxz4WkCSTWT5Zf6+JngXYylDZta+/HnzRMczhG9Laaa+TRhm+fsxApQ4wORvdms3xwcxg35FTzUy4gMoSCLFiNjN7e/GZWsb9NYlFoI/sfhqVsNljFJlN4+XgqEGyU1tn4ggdBeQ9J4/E6NUkvu8+lWqfvNrapGNm2+3J7hAIvfpNo/sOXLGfbHjXu+hM3RWkxgvVKecqMeEAO0MSNZouIRMKmT/qHz15Ds7vww0lkRKQG2xcXFitLVCglcAe2ApriNTAY19MWBVVMUKfY=",
"values": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ entitlements:
meta:
lastupdated: 0001-01-01T00:00:00Z
customerid: ""
signature: replaced signature
serialized: '{"entitlements":[],"meta":{"customerID":"CKk--APIp5SkXA0Z5os1hne8Sr_McDmI","lastUpdated":"0001-01-01T00:00:00Z"}}'
signature: eVlVacoh3aPSx+EvhmD+B8vG3QicsaWkJ+9vcFReB2xRgPtNgedfQkS7bmJxNwCHZlcOXX/m1io5IkFFXPdW4mXvIRO/5p6xJWFj/icU1iHOBPYf6Q2pEC9+ylXAj8upyPPGGJc+MN5X83Sxk/JumRJPMCNoykwgixkai7NtiZgEjvyfMLPZhYwZ5MBNEv6CJ5NCCw7JO1Ga8G6CDa6E3NLsFJLLLcYUQO+7+hDb9IMxkynHJCoazJ1587fVUgeZ1QLt+mWdJoILn+ioDH4TJ0XZMWvLdRDoV6JTugs1O3O9qh3sMu5C2fow0i3Cnr+K8DsWDpazXTBQzd2ZIuUFf02CgCEF+0M/o9DMbpocePjmHufxZXcEl3jv8rMv5wa6civwRA9W8dbv+eepMf4ngcUP/hxz4WkCSTWT5Zf6+JngXYylDZta+/HnzRMczhG9Laaa+TRhm+fsxApQ4wORvdms3xwcxg35FTzUy4gMoSCLFiNjN7e/GZWsb9NYlFoI/sfhqVsNljFJlN4+XgqEGyU1tn4ggdBeQ9J4/E6NUkvu8+lWqfvNrapGNm2+3J7hAIvfpNo/sOXLGfbHjXu+hM3RWkxgvVKecqMeEAO0MSNZouIRMKmT/qHz15Ds7vww0lkRKQG2xcXFitLVCglcAe2ApriNTAY19MWBVVMUKfY=
values:
- key: my_field
value: The default
Expand Down
1 change: 0 additions & 1 deletion integration/init_app/license-info/metadata.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ app_slug: "ship-integration-testing"
release_version: "0.0.1"
replacements:
"installed.*" : "installed: replaced datetime"
"signature.*" : "signature: replaced signature"
skip_cleanup: false
skip_edit: false
skip_init: true
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"v1": {
"config": {},
"upstream": "__upstream__",
"contentSHA": "9891fe3082c1abccbb13771004f397307e2cb084586e940c02bf6ca77f4e5944",
"contentSHA": "ecde9a9503806a80c7d65366b4484c4d8aaba13af29057849bd5c3475a760a42",
"metadata": {
"applicationType": "replicated.app",
"license": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@
"arch": "amd64"
}
},
"contentSHA": "251f17dc410c816470730c309d9304af29980150047b736cc7861271785410a1"
"contentSHA": "1e6ffe4f71d9add6383fed0de4e837e5caba04b40b87a216371fed889e2f78e3"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@
"arch": "amd64"
}
},
"contentSHA": "251f17dc410c816470730c309d9304af29980150047b736cc7861271785410a1"
"contentSHA": "1e6ffe4f71d9add6383fed0de4e837e5caba04b40b87a216371fed889e2f78e3"
}
}
2 changes: 1 addition & 1 deletion integration/update/app_basic/expected/.ship/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"v1": {
"config": {},
"upstream": "staging.replicated.app/some-cool-ci-tool?installation_id=3Z6uuPbVz6jTxRuXHn_l6UlYQz3hWz6-&customer_id=-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
"contentSHA": "674dfc6dbef7422277ad215e875f978f9c1d5d51429e1e231e461c3cee0954cb",
"contentSHA": "aafa722a828058d1da1eee0ee2f449533b9ddff13534ea94760fd177ab79e864",
"metadata": {
"applicationType": "replicated.app",
"customerID": "-Am-_6i5pw0u4AbspOwKN4lZUCn49u_G",
Expand Down
1 change: 1 addition & 0 deletions pkg/api/entitlements.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Utilization struct {
// Entitlements is a signed object containing entitlments info+metadata
type Entitlements struct {
Meta Meta `json:"meta"`
Serialized string `json:"serialized"`
Signature string `json:"signature"`
Values []EntitlementValue `json:"values,omitempty"`
Utilizations []Utilization `json:"utilizations,omitempty"`
Expand Down
2 changes: 1 addition & 1 deletion pkg/specs/interface_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ func TestResolver_ReadContentSHAForWatch(t *testing.T) {
AppSlug: "",
}).Return(&state2.ShipRelease{Spec: "its fake"}, nil)
},
expectSHA: "c28f8f4146e25744f36644d3ff1c0dfbae4898a34d581238057b1fce2448f13d", // sha256.Sum256(json.Marshal(state2.ShipRelease{Spec: "its fake"}))
expectSHA: "6a479c38783839a2ace8f6b1060536e35d87d0b9a5ccc792e9c9032bfb313c4a", // sha256.Sum256(json.Marshal(state2.ShipRelease{Spec: "its fake"}))
},
}
for _, test := range tests {
Expand Down

0 comments on commit 44a7223

Please sign in to comment.