Skip to content

Commit

Permalink
fix: fixing dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Plictox committed Jun 16, 2023
1 parent b50ab2e commit 78793be
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 27 deletions.
2 changes: 2 additions & 0 deletions learn-ocaml-client.opam
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ depends: [
"ppx_tools"
"safepass"
"ssl" {= "0.5.12"}
"tyxml-js"
"ocaml-url"
"vg"
]
build: [
Expand Down
2 changes: 2 additions & 0 deletions learn-ocaml.opam
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,9 @@ depends: [
"re"
"safepass"
"ssl" {= "0.5.12"}
"tyxml-js"
"uutf" {>= "1.0" }
"ocaml-url"
"vg"
"yojson" {>= "1.4.0" }
]
Expand Down
43 changes: 24 additions & 19 deletions src/app/dune
Original file line number Diff line number Diff line change
Expand Up @@ -128,78 +128,83 @@

(executable
(name learnocaml_lti_main)
(modes byte)
(modes byte js)
(flags :standard -warn-error -6-9-27-33-39)
(libraries ezjsonm
ace
sha
learnocaml_repository
learnocaml_app_common
learnocaml_toplevel
js_of_ocaml.ppx
ocplib_i18n)
js_of_ocaml-ppx
ocplib_i18n
js_of_ocaml-tyxml
str)
(modules Learnocaml_lti_main)
(preprocess (pps ppx_ocplib_i18n js_of_ocaml.ppx))
(preprocess (pps ppx_ocplib_i18n js_of_ocaml-ppx))
(js_of_ocaml
(flags :standard +cstruct/cstruct.js)
(javascript_files ../ace-lib/ace_bindings.js))
)

(executable
(name learnocaml_reset_main)
(modes byte)
(modes byte js)
(flags :standard -warn-error -6-9-27-33-39)
(libraries ace
learnocaml_app_common
js_of_ocaml.ppx
js_of_ocaml-ppx
ocplib_i18n)
(modules Learnocaml_reset_main)
(preprocess (pps ppx_ocplib_i18n js_of_ocaml.ppx))
(preprocess (pps ppx_ocplib_i18n js_of_ocaml-ppx))
(js_of_ocaml
(flags :standard +cstruct/cstruct.js)
(javascript_files ../ace-lib/ace_bindings.js))
)

(executable
(name learnocaml_upgrade_main)
(modes byte)
(modes byte js)
(flags :standard -warn-error -6-9-27-33-39)
(libraries ace
learnocaml_app_common
js_of_ocaml.ppx
ocplib_i18n)
js_of_ocaml-ppx
ocplib_i18n
uri)
(modules Learnocaml_upgrade_main)
(preprocess (pps ppx_ocplib_i18n js_of_ocaml.ppx))
(preprocess (pps ppx_ocplib_i18n js_of_ocaml-ppx))
(js_of_ocaml
(flags :standard +cstruct/cstruct.js)
(javascript_files ../ace-lib/ace_bindings.js))
)

(executable
(name learnocaml_redirection_main)
(modes byte)
(modes byte js)
(flags :standard -warn-error -6-9-27-33-39)
(libraries ace
learnocaml_app_common
js_of_ocaml.ppx
ocplib_i18n)
js_of_ocaml-ppx
ocplib_i18n
js_of_ocaml-tyxml)
(modules Learnocaml_redirection_main)
(preprocess (pps ppx_ocplib_i18n js_of_ocaml.ppx))
(preprocess (pps ppx_ocplib_i18n js_of_ocaml-ppx))
(js_of_ocaml
(flags :standard +cstruct/cstruct.js)
(javascript_files ../ace-lib/ace_bindings.js))
)

(executable
(name learnocaml_validate_main)
(modes byte)
(modes byte js)
(flags :standard -warn-error -6-9-27-33-39)
(libraries ace
learnocaml_app_common
js_of_ocaml.ppx
ocplib_i18n)
js_of_ocaml-ppx
ocplib_i18n
uri)
(modules Learnocaml_validate_main)
(preprocess (pps ppx_ocplib_i18n js_of_ocaml.ppx))
(preprocess (pps ppx_ocplib_i18n js_of_ocaml-ppx))
(js_of_ocaml
(flags :standard +cstruct/cstruct.js)
(javascript_files ../ace-lib/ace_bindings.js))
Expand Down
6 changes: 3 additions & 3 deletions src/app/learnocaml_lti_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ open Js_utils
open Lwt
open Learnocaml_common

module H = Tyxml_js.Html5
module H = Js_of_ocaml_tyxml.Tyxml_js.Html5

let check_email_js email =
let re = Regexp.regexp Learnocaml_data.email_regexp_js in
let re = Str.regexp Learnocaml_data.email_regexp_js in
Learnocaml_data.email_check_length email
&& match Regexp.string_match re email 0 with
&& match Str.string_match re email 0 with
| Some _ -> true
| None -> false

Expand Down
3 changes: 2 additions & 1 deletion src/app/learnocaml_redirection_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
* included LICENSE file for details. *)

open Learnocaml_common
open Js_of_ocaml

module H = Tyxml_js.Html
module H = Js_of_ocaml_tyxml.Tyxml_js.Html

let rec drop_2_trailing = function
| [] | [_] | [_; _] -> []
Expand Down
1 change: 1 addition & 0 deletions src/app/learnocaml_upgrade_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
open Js_utils
open Lwt
open Learnocaml_common
open Js_of_ocaml

module El = struct
let id s = s, find_component s
Expand Down
1 change: 1 addition & 0 deletions src/app/learnocaml_validate_main.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
* included LICENSE file for details. *)

open Learnocaml_common
open Js_of_ocaml

let rec drop_2_trailing = function
| [] | [_] | [_; _] -> []
Expand Down
3 changes: 2 additions & 1 deletion src/server/dune
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
token_index
learnocaml_partition_create
cryptokit
markup)
markup
base64)
)
2 changes: 1 addition & 1 deletion src/server/learnocaml_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ let check_report exo report grade =
let generate_csrf_token length =
let random_bytes = Bytes.make length '\000' in
Cryptokit.Random.secure_rng#random_bytes random_bytes 0 length;
B64.encode (Bytes.to_string random_bytes)
Base64.encode (Bytes.to_string random_bytes)

let generate_hmac secret csrf user_id =
let decoder = Cryptokit.Hexa.decode () in
Expand Down
2 changes: 1 addition & 1 deletion src/state/dune
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
(name token_index)
(wrapped false)
(modules Token_index)
(libraries lwt lwt.unix lwt_utils learnocaml_api learnocaml_data cryptokit netstring safepass)
(libraries base64 lwt lwt.unix lwt_utils learnocaml_api learnocaml_data cryptokit netstring safepass)
)

(library
Expand Down
2 changes: 1 addition & 1 deletion src/state/token_index.ml
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ let signature_oauth list_args http_method basic_uri secret =
let encoding =
let hash = Cryptokit.MAC.hmac_sha1 signing_key in
let result = Cryptokit.hash_string hash signature_base_string in
B64.encode result
Base64.encode result
in encoding

let oauth_signature_method = "HMAC-SHA1"
Expand Down

0 comments on commit 78793be

Please sign in to comment.