@@ -11,18 +11,20 @@ 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"`
16- Workspace string `json:"workspace"`
14+ RefID string
15+ APIKey string `json:"api_key"`
16+ Organization string `json:"organization"`
17+ Workspace string `json:"workspace"`
1718}
1819
1920var _ v1.CloudCredential = & SFCCredentialV2 {}
2021
21- func NewSFCCredentialV2 (refID string , apiKey string , workspace string ) * SFCCredentialV2 {
22+ func NewSFCCredentialV2 (refID string , apiKey string , organization string , workspace string ) * SFCCredentialV2 {
2223 return & SFCCredentialV2 {
23- RefID : refID ,
24- APIKey : apiKey ,
25- Workspace : workspace ,
24+ RefID : refID ,
25+ APIKey : apiKey ,
26+ Organization : organization ,
27+ Workspace : workspace ,
2628 }
2729}
2830
@@ -44,11 +46,12 @@ func (c *SFCCredentialV2) GetTenantID() (string, error) {
4446
4547type SFCClientV2 struct {
4648 v1.NotImplCloudClient
47- refID string
48- workspace string
49- location string
50- client * sfc.SDK
51- logger v1.Logger
49+ refID string
50+ organization string
51+ workspace string
52+ location string
53+ client * sfc.SDK
54+ logger v1.Logger
5255}
5356
5457var _ v1.CloudClient = & SFCClientV2 {}
@@ -63,11 +66,12 @@ func WithLogger(logger v1.Logger) SFCClientV2Option {
6366
6467func (c * SFCCredentialV2 ) MakeClientWithOptions (_ context.Context , location string , opts ... SFCClientV2Option ) (v1.CloudClient , error ) {
6568 sfcClient := & SFCClientV2 {
66- refID : c .RefID ,
67- workspace : c .Workspace ,
68- location : location ,
69- client : sfc .New (sfc .WithSecurity (c .APIKey )),
70- logger : & v1.NoopLogger {},
69+ refID : c .RefID ,
70+ organization : c .Organization ,
71+ workspace : c .Workspace ,
72+ location : location ,
73+ client : sfc .New (sfc .WithSecurity (c .APIKey )),
74+ logger : & v1.NoopLogger {},
7175 }
7276
7377 for _ , opt := range opts {
@@ -89,6 +93,10 @@ func (c *SFCClientV2) GetCloudProviderID() v1.CloudProviderID {
8993 return CloudProviderID
9094}
9195
96+ func (c * SFCClientV2 ) GetOrganization () string {
97+ return c .organization
98+ }
99+
92100func (c * SFCClientV2 ) GetWorkspace () string {
93101 return c .workspace
94102}
0 commit comments