@@ -48,6 +48,7 @@ func (a *ManifestAPI) GetManifest(ctx context.Context, _ *agentproto.GetManifest
48
48
metadata []database.WorkspaceAgentMetadatum
49
49
workspace database.Workspace
50
50
devcontainers []database.WorkspaceAgentDevcontainer
51
+ userSecrets []database.UserSecret
51
52
)
52
53
53
54
var eg errgroup.Group
@@ -84,6 +85,13 @@ func (a *ManifestAPI) GetManifest(ctx context.Context, _ *agentproto.GetManifest
84
85
}
85
86
return nil
86
87
})
88
+ eg .Go (func () (err error ) {
89
+ userSecrets , err = a .Database .ListUserSecrets (ctx , workspace .OwnerID )
90
+ if err != nil && ! xerrors .Is (err , sql .ErrNoRows ) {
91
+ return err
92
+ }
93
+ return nil
94
+ })
87
95
err = eg .Wait ()
88
96
if err != nil {
89
97
return nil , xerrors .Errorf ("fetching workspace agent data: %w" , err )
@@ -140,9 +148,24 @@ func (a *ManifestAPI) GetManifest(ctx context.Context, _ *agentproto.GetManifest
140
148
Apps : apps ,
141
149
Metadata : dbAgentMetadataToProtoDescription (metadata ),
142
150
Devcontainers : dbAgentDevcontainersToProto (devcontainers ),
151
+
152
+ UserSecrets : dbUserSecretsToProto (userSecrets ),
143
153
}, nil
144
154
}
145
155
156
+ func dbUserSecretsToProto (userSecrets []database.UserSecret ) map [string ]* agentproto.Secret {
157
+ userSecretsProto := make (map [string ]* agentproto.Secret )
158
+ for _ , userSecret := range userSecrets {
159
+ userSecretsProto [userSecret .Name ] = & agentproto.Secret {
160
+ Name : userSecret .Name ,
161
+ EnvName : userSecret .EnvName ,
162
+ FilePath : userSecret .FilePath ,
163
+ }
164
+ }
165
+
166
+ return userSecretsProto
167
+ }
168
+
146
169
func vscodeProxyURI (app appurl.ApplicationURL , accessURL * url.URL , appHost string ) string {
147
170
// Proxying by port only works for subdomains. If subdomain support is not
148
171
// available, return an empty string.
0 commit comments