Skip to content

Commit

Permalink
Add support for signed upload urls.
Browse files Browse the repository at this point in the history
  • Loading branch information
erikcarlsson committed Dec 19, 2024
1 parent 866929a commit 3d7696f
Show file tree
Hide file tree
Showing 20 changed files with 824 additions and 783 deletions.
34 changes: 34 additions & 0 deletions cli/daemon/run/runtime_config2.go
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,11 @@ func (g *RuntimeConfigGenerator) initialize() error {
Gcs: &runtimev1.BucketCluster_GCS{
Endpoint: &bktProviderConfig.GCS.Endpoint,
Anonymous: true,
LocalSign: &runtimev1.BucketCluster_GCS_LocalSignOptions{
BaseUrl: publicBaseURL,
AccessId: "dummy-sa@encore.local",
PrivateKey: dummyPrivateKey,
},
},
},
})
Expand Down Expand Up @@ -833,3 +838,32 @@ func gzipBytes(data []byte) []byte {
_ = w.Close()
return buf.Bytes()
}

const dummyPrivateKey = `-----BEGIN PRIVATE KEY-----
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCuqGuf20fyTPGw
tkUjBRZMh9T5eyGxkw9aZkQWJAENiZE/NkpHaErvrhRhgI5q59nxDDaPoomGuOdV
weFRoq9tb+WDxA0gwDi+3eY4D99kepfGjrnovh4Pmt3PoCTAUd+ODIxJCZ9o6YNe
Qp3fk1XYoLYldCONRCbq00frnZG+IGQFRH7VXjOcbgxkKUvZhFyX/W+tOLCBfkuB
mRFVw0sxxvdhMbKaDknq0c4AoF6MDFb8mfEqxF0eFK/VQ9dD53v4VLRREOb7CMAv
KHPf5ikz94eiiEEug24FboXXtntxH/W0wU5pUkflyx22Onk4rbPpv5f/NbzetdkF
B2OiUluvAgMBAAECggEALYAAsZ9didjTqdaCAlKD8aH9MJUMPQdzm3hCyoXMpGsv
JImPJjUcOH5gHtpvv5fw5ePpnteX/jnTQjsE6NB55Qeeggoj5WFOJyMFo5s29iUd
vwNVmTVV/Xi5yioNCPELTSUlsq1IEvuqVncCS8lFNu7/JJix3k5f2RL7jHz7B81X
KNZ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ATE KEY-----`
7 changes: 7 additions & 0 deletions pkg/rtconfgen/convert.go
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,13 @@ func (c *legacyConverter) Convert() (*config.Runtime, error) {
Endpoint: prov.Gcs.GetEndpoint(),
Anonymous: prov.Gcs.Anonymous,
}
if opt := prov.Gcs.LocalSign; opt != nil {
p.GCS.LocalSign = &config.GCSLocalSignOptions{
BaseUrl: opt.BaseUrl,
AccessId: opt.AccessId,
PrivateKey: opt.PrivateKey,
}
}
default:
c.setErrf("unknown object storage provider type %T", prov)
continue
Expand Down
Loading

0 comments on commit 3d7696f

Please sign in to comment.