@@ -11,16 +11,18 @@ const CloudProviderID = "sfcompute"
1111
1212// SFCCredentialV2 holds authentication details for a Brev-managed SFCompute V2 account.
1313type SFCCredentialV2 struct {
14- RefID string
15- APIKey string `json:"api_key"`
14+ RefID string
15+ APIKey string `json:"api_key"`
16+ Workspace string `json:"workspace"`
1617}
1718
1819var _ v1.CloudCredential = & SFCCredentialV2 {}
1920
20- func NewSFCCredentialV2 (refID , apiKey string ) * SFCCredentialV2 {
21+ func NewSFCCredentialV2 (refID string , apiKey string , workspace string ) * SFCCredentialV2 {
2122 return & SFCCredentialV2 {
22- RefID : refID ,
23- APIKey : apiKey ,
23+ RefID : refID ,
24+ APIKey : apiKey ,
25+ Workspace : workspace ,
2426 }
2527}
2628
@@ -42,10 +44,11 @@ func (c *SFCCredentialV2) GetTenantID() (string, error) {
4244
4345type SFCClientV2 struct {
4446 v1.NotImplCloudClient
45- refID string
46- location string
47- client * sfc.SDK
48- logger v1.Logger
47+ refID string
48+ workspace string
49+ location string
50+ client * sfc.SDK
51+ logger v1.Logger
4952}
5053
5154var _ v1.CloudClient = & SFCClientV2 {}
@@ -60,10 +63,11 @@ func WithLogger(logger v1.Logger) SFCClientV2Option {
6063
6164func (c * SFCCredentialV2 ) MakeClientWithOptions (_ context.Context , location string , opts ... SFCClientV2Option ) (v1.CloudClient , error ) {
6265 sfcClient := & SFCClientV2 {
63- refID : c .RefID ,
64- location : location ,
65- client : sfc .New (sfc .WithSecurity (c .APIKey )),
66- logger : & v1.NoopLogger {},
66+ refID : c .RefID ,
67+ workspace : c .Workspace ,
68+ location : location ,
69+ client : sfc .New (sfc .WithSecurity (c .APIKey )),
70+ logger : & v1.NoopLogger {},
6771 }
6872
6973 for _ , opt := range opts {
@@ -85,6 +89,10 @@ func (c *SFCClientV2) GetCloudProviderID() v1.CloudProviderID {
8589 return CloudProviderID
8690}
8791
92+ func (c * SFCClientV2 ) GetWorkspace () string {
93+ return c .workspace
94+ }
95+
8896func (c * SFCClientV2 ) GetReferenceID () string {
8997 return c .refID
9098}
0 commit comments