Skip to content

Commit 63728d7

Browse files
authored
Merge pull request #54 from loopholelabs/staging
Release v0.3.4
2 parents 13edc4a + c98b005 commit 63728d7

File tree

10 files changed

+67
-57
lines changed

10 files changed

+67
-57
lines changed

CHANGELOG.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

88
## [Unreleased]
99

10+
## [v0.3.4] - 2023-02-17
11+
12+
### Changes
13+
14+
- Bumping `scale-signature` version to `v0.2.9`
15+
- Bumping `scale-signature-http` version to `v0.3.4`
16+
- Bumping `scalefile` version to `v0.1.7`
17+
- Updating `storage` libraries for both TS and Go to use the new `scalefile` library
18+
1019
## [v0.3.3] - 2023-02-17
1120

1221
### Changes
@@ -86,7 +95,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
8695

8796
- Initial release of the Scale Runtime library.
8897

89-
[unreleased]: https://github.com/loopholelabs/scale/compare/v0.3.3...HEAD
98+
[unreleased]: https://github.com/loopholelabs/scale/compare/v0.3.4...HEAD
99+
[v0.3.4]: https://github.com/loopholelabs/scale/compare/v0.3.4
90100
[v0.3.3]: https://github.com/loopholelabs/scale/compare/v0.3.3
91101
[v0.3.2]: https://github.com/loopholelabs/scale/compare/v0.3.2
92102
[v0.3.1]: https://github.com/loopholelabs/scale/compare/v0.3.1

go.mod

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ require (
1010
github.com/google/uuid v1.3.0
1111
github.com/loopholelabs/auth v0.2.25
1212
github.com/loopholelabs/polyglot-go v0.5.1
13-
github.com/loopholelabs/scale-signature v0.2.8
14-
github.com/loopholelabs/scale-signature-http v0.3.3
15-
github.com/loopholelabs/scalefile v0.1.6
13+
github.com/loopholelabs/scale-signature v0.2.9
14+
github.com/loopholelabs/scale-signature-http v0.3.4
15+
github.com/loopholelabs/scalefile v0.1.7
1616
github.com/stretchr/testify v1.8.1
1717
github.com/tetratelabs/wazero v1.0.0-pre.8
1818
)

go.sum

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -96,12 +96,12 @@ github.com/loopholelabs/auth v0.2.25 h1:0uO/Noub9c/CGZPLwwFIZM6r2zMHyfy07oUZkpyY
9696
github.com/loopholelabs/auth v0.2.25/go.mod h1:8jY3kru3zYytaH6gmtt6i0qQO1BGfLrZlem1RlR1ENs=
9797
github.com/loopholelabs/polyglot-go v0.5.1 h1:21QVDELp+EodPUAL+Aw8GNXLyt2BFj9gYQsGvHIFlcc=
9898
github.com/loopholelabs/polyglot-go v0.5.1/go.mod h1:Z0QiNv4KRuWjQWpUerMhmkvRh6ks1pYmEH4SGpG0EHQ=
99-
github.com/loopholelabs/scale-signature v0.2.8 h1:1vXJwN4DrQ8ChexWZ/2HfxEFYcOMfpftcdyoOWjHg6U=
100-
github.com/loopholelabs/scale-signature v0.2.8/go.mod h1:l2GuQ2REoBiTkfFP3vuyNHssMJMnre5I95ZMiBNOBe0=
101-
github.com/loopholelabs/scale-signature-http v0.3.3 h1:ULGd40j3ofgk56wmBeGcf+FJBsgA0vZ5awWuo/NHmdo=
102-
github.com/loopholelabs/scale-signature-http v0.3.3/go.mod h1:0+0AZg54oIVYBGS/QluS0xGPJv+V4ST9GhckN+sbzTM=
103-
github.com/loopholelabs/scalefile v0.1.6 h1:JhfFdqK4Escn6/vJyZkEFnqtjleVpA7ihLbEAXRZGCM=
104-
github.com/loopholelabs/scalefile v0.1.6/go.mod h1:fPq4xcXpAzWErW1tqLTex2xIrHJ/iCRFb4et6+sbOvk=
99+
github.com/loopholelabs/scale-signature v0.2.9 h1:KGYslPu33VJ+MUQc6uWqiVW2u2On3Z1Tg6FUJeqfQ/4=
100+
github.com/loopholelabs/scale-signature v0.2.9/go.mod h1:4odernLaTjU6UPCkxG+TySEvpYaDtPJ6JvRJxh9d124=
101+
github.com/loopholelabs/scale-signature-http v0.3.4 h1:GBwh8+cFXmt90agABKx06vEkPsKQEWNwgV6Uh93HDvE=
102+
github.com/loopholelabs/scale-signature-http v0.3.4/go.mod h1:Vokp2v5cT6R3dBt4hTszRizhm1o00NS4lnASxb/5JtE=
103+
github.com/loopholelabs/scalefile v0.1.7 h1:2MEBXayKDQErovlHQKyANINTvLeEHV9skrmc8Xx0OHo=
104+
github.com/loopholelabs/scalefile v0.1.7/go.mod h1:fPq4xcXpAzWErW1tqLTex2xIrHJ/iCRFb4et6+sbOvk=
105105
github.com/mailru/easyjson v0.0.0-20190614124828-94de47d64c63/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
106106
github.com/mailru/easyjson v0.0.0-20190626092158-b2ccc519800e/go.mod h1:C1wdFJiN94OJF2b5HbByQZoLdCWB1Yqtg26g4irojpc=
107107
github.com/mailru/easyjson v0.7.6/go.mod h1:xzfreul335JAWq5oZzymOObrkdz5UnU4kGfJJLY9Nlc=

go/runtime_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ func TestRuntimeRs(t *testing.T) {
428428
dependencies := []*scalefile.Dependency{
429429
{
430430
Name: "scale_signature",
431-
Version: "0.2.8",
431+
Version: "0.2.9",
432432
},
433433
}
434434

@@ -635,11 +635,11 @@ func TestRuntimeHTTPSignatureRs(t *testing.T) {
635635
dependencies := []*scalefile.Dependency{
636636
{
637637
Name: "scale_signature",
638-
Version: "0.2.8",
638+
Version: "0.2.9",
639639
},
640640
{
641641
Name: "scale_signature_http",
642-
Version: "0.3.3",
642+
Version: "0.3.4",
643643
},
644644
}
645645

go/storage/storage.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ func New(baseDirectory string) (*Storage, error) {
7979
// Get returns the Scale Function with the given name, tag, and organization.
8080
// The hash parameter is optional and can be used to check for a specific hash.
8181
func (s *Storage) Get(name string, tag string, org string, hash string) (*Entry, error) {
82-
if name == "" || !scalefunc.ValidName(name) {
82+
if name == "" || !scalefunc.ValidString(name) {
8383
return nil, ErrInvalidName
8484
}
8585

86-
if tag == "" || !scalefunc.ValidName(tag) {
86+
if tag == "" || !scalefunc.ValidString(tag) {
8787
return nil, ErrInvalidTag
8888
}
8989

90-
if org == "" || !scalefunc.ValidName(org) {
90+
if org == "" || !scalefunc.ValidString(org) {
9191
return nil, ErrInvalidOrganization
9292
}
9393

@@ -174,15 +174,15 @@ func (s *Storage) fullPath(p string) string {
174174
}
175175

176176
func (s *Storage) functionName(name string, tag string, org string, hash string) string {
177-
return fmt.Sprintf("%s.%s.%s.%s.scale", org, name, tag, hash)
177+
return fmt.Sprintf("%s_%s_%s_%s_scale", org, name, tag, hash)
178178
}
179179

180180
func (s *Storage) functionSearch(name string, tag string, org string) string {
181-
return fmt.Sprintf("%s.%s.%s.*.scale", org, name, tag)
181+
return fmt.Sprintf("%s_%s_%s_*_scale", org, name, tag)
182182
}
183183

184184
func (s *Storage) getHashFromFileName(fileName string) string {
185-
split := strings.Split(fileName, ".")
185+
split := strings.Split(fileName, "_")
186186
if len(split) != 5 {
187187
return ""
188188
}
@@ -191,7 +191,7 @@ func (s *Storage) getHashFromFileName(fileName string) string {
191191
}
192192

193193
func (s *Storage) getOrgFromFileName(fileName string) string {
194-
split := strings.Split(fileName, ".")
194+
split := strings.Split(fileName, "_")
195195
if len(split) != 5 {
196196
return ""
197197
}

package-lock.json

Lines changed: 24 additions & 24 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@loopholelabs/scale-ts",
3-
"version": "0.3.3",
3+
"version": "0.3.4",
44
"description": "Scale is a highly-performant WebAssembly function runtime that enables composable, language-agnostic software development.",
55
"source": "./ts/index.ts",
66
"main": "dist/main.js",
@@ -21,9 +21,9 @@
2121
},
2222
"dependencies": {
2323
"@loopholelabs/polyglot-ts": "^0.4.0",
24-
"@loopholelabs/scale-signature": "^0.2.8",
25-
"@loopholelabs/scale-signature-http": "^0.3.3",
26-
"@loopholelabs/scalefile": "^0.1.6",
24+
"@loopholelabs/scale-signature": "^0.2.9",
25+
"@loopholelabs/scale-signature-http": "^0.3.4",
26+
"@loopholelabs/scalefile": "^0.1.7",
2727
"@swc/helpers": "^0.4.12",
2828
"@types/jest": "^29.2.0",
2929
"@types/node-fetch": "^2.6.2",

rust/tests/signature/bad-signature/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ path = "lib.rs"
99

1010
[dependencies]
1111
polyglot_rs = "0.6.1"
12-
scale_signature = "0.2.7"
12+
scale_signature = "0.2.9"

rust/tests/signature/example-signature/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ path = "lib.rs"
99

1010
[dependencies]
1111
polyglot_rs = "0.6.1"
12-
scale_signature = "0.2.7"
12+
scale_signature = "0.2.9"

ts/storage/index.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ export class Storage{
2626
}
2727

2828
public Get(name: string, tag: string, org: string, hash: string | undefined): (Entry | undefined) {
29-
if (name.length === 0 || !ScaleFunc.ValidName(name)) {
29+
if (name.length === 0 || !ScaleFunc.ValidString(name)) {
3030
throw ErrInvalidName;
3131
}
3232

33-
if (tag.length === 0 || !ScaleFunc.ValidName(tag)) {
33+
if (tag.length === 0 || !ScaleFunc.ValidString(tag)) {
3434
throw ErrInvalidTag;
3535
}
3636

37-
if (org.length === 0 || !ScaleFunc.ValidName(org)) {
37+
if (org.length === 0 || !ScaleFunc.ValidString(org)) {
3838
throw ErrInvalidOrg;
3939
}
4040

@@ -68,8 +68,8 @@ export class Storage{
6868

6969
return {
7070
scaleFunc: ScaleFunc.Read(matches[0]),
71-
hash: matches[0].split(".")[3],
72-
organization: matches[0].split(".")[0],
71+
hash: matches[0].split("_")[3],
72+
organization: matches[0].split("_")[0],
7373
};
7474
}
7575

@@ -90,11 +90,11 @@ export class Storage{
9090
}
9191

9292
private functionName(name: string, tag: string, org: string, hash: string): string {
93-
return `${org}.${name}.${tag}.${hash}.scale`;
93+
return `${org}_${name}_${tag}_${hash}_scale`;
9494
}
9595

9696
private functionSearch(name: string, tag: string, org: string): string {
97-
return `${org}.${name}.${tag}.*.scale`;
97+
return `${org}_${name}_${tag}_*_scale`;
9898
}
9999
}
100100

0 commit comments

Comments
 (0)