Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pass secrets through in F# analysis #4128

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion fsharp-backend/src/LibExecution/OCamlTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,8 @@ module Convert =
| BSTypes.UserType ut -> PT.Toplevel.TLType(ocamlUserType2PT ut)
| BSTypes.UserFn uf -> PT.Toplevel.TLFunction(ocamlUserFunction2PT uf)


let ocamlSecret2RT (secret : secret) : RT.Secret.T =
{ name = secret.secret_name; value = secret.secret_value }
Comment on lines +676 to +677
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was slightly surprised to see a RT value here rather than a PT value, but that's what's expected by analysis.


// ----------------
// ProgramTypes to OCaml
Expand Down
5 changes: 4 additions & 1 deletion fsharp-backend/src/Wasm/Wasm.fs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ module Eval =
(userTypes : List<ORT.user_tipe>)
(dbs : List<ORT.fluidExpr ORT.DbT.db>)
(expr : ORT.fluidExpr)
(secrets : List<OT.secret>)
: Task<ClientInterop.AnalysisEnvelope> =
task {
let program : RT.ProgramContext =
Expand All @@ -194,7 +195,7 @@ module Eval =
|> List.map PT2RT.DB.toRT
|> List.map (fun t -> t.name, t)
|> Map
secrets = [] }
secrets = secrets |> List.map (OT.Convert.ocamlSecret2RT) }

let stdlib =
LibExecutionStdLib.StdLib.fns
Expand Down Expand Up @@ -250,6 +251,7 @@ module Eval =
ah.user_tipes
(List.map ClientInterop.convert_db ah.dbs)
ah.handler.ast
ah.secrets
| ClientInterop.AnalyzeFunction af ->
runAnalysis
af.func.tlid
Expand All @@ -259,6 +261,7 @@ module Eval =
af.user_tipes
(List.map ClientInterop.convert_db af.dbs)
af.func.ast
af.secrets

open System
open System.Reflection
Expand Down