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

sans cstruct #66

Merged
merged 11 commits into from
Dec 16, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build-master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v2
with:
persist-credentials: falsene
persist-credentials: false

- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}
Expand Down
16 changes: 6 additions & 10 deletions .github/workflows/check-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Check PR
on:
pull_request:
branches:
- master
- master

jobs:
opam:
Expand All @@ -13,10 +13,10 @@ jobs:
os:
- macos-latest
- ubuntu-latest
- windows-latest
# - windows-latest
ocaml-compiler:
- 4.13.x
- 4.08.x
- 4.14.x
- 5.2.x

runs-on: ${{ matrix.os }}

Expand Down Expand Up @@ -45,23 +45,19 @@ jobs:
with:
persist-credentials: false

- uses: cachix/install-nix-action@v22
- uses: cachix/install-nix-action@v30
with:
extra_nix_config: |
access-tokens = github.com=${{ secrets.GITHUB_TOKEN }}

- uses: cachix/cachix-action@v12
with:
name: anmonteiro

- name: Build
run: nix develop --accept-flake-config -c dune build

- name: Test with coverage
run: nix develop --accept-flake-config -c dune build @runtest --instrument-with bisect_ppx --force

- name: Upload coverage
run: nix develop --accept-flake-config -c bisect-ppx-report send-to Codecov
run: nix develop --accept-flake-config -c bisect-ppx-report send-to Codecov --repo-token="${{ secrets.CODECOV_TOKEN }}"

- name: Build docs
run: nix develop --accept-flake-config -c dune build @doc
2 changes: 1 addition & 1 deletion .ocamlformat
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version = 0.24.1
version = 0.27.0

wrap-comments = false
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
next
--------------
- Upgrade mirage-crypto and remove cstruct

0.9.0
--------------
- Support all serialization formats, previously only the compact serialization was supported, now we support both general and flattened JSON format (by @ulrikstrid)
Expand Down
7 changes: 3 additions & 4 deletions dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,9 @@
(eqaf
(>= 0.7))
(mirage-crypto
(>= 0.10.0))
(>= 1.0.0))
(x509
(>= 0.13.0))
(cstruct
(>= 6.0.0))
astring
(yojson
(>= 1.6.0))
Expand All @@ -46,7 +44,8 @@
(mirage-crypto-rng
(and
:with-test
(>= 0.11.0)))
(>= 1.0.0)))
digestif
(containers :with-test)
(bisect_ppx :with-test)
(alcotest :with-test)
Expand Down
84 changes: 22 additions & 62 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions jose.opam
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ depends: [
"base64" {>= "3.3.0"}
"dune" {>= "2.8"}
"eqaf" {>= "0.7"}
"mirage-crypto" {>= "0.10.0"}
"mirage-crypto" {>= "1.0.0"}
"x509" {>= "0.13.0"}
"cstruct" {>= "6.0.0"}
"astring"
"yojson" {>= "1.6.0"}
"zarith"
"ptime"
"mirage-crypto-rng" {with-test & >= "0.11.0"}
"mirage-crypto-rng" {with-test & >= "1.0.0"}
"digestif"
"containers" {with-test}
"bisect_ppx" {with-test}
"alcotest" {with-test}
Expand Down
5 changes: 2 additions & 3 deletions jose/Header.ml
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,9 @@ let to_json t =
`Assoc (List.filter_map Fun.id values @ t.extra)

let of_string header_str =
let s = U_Base64.url_decode header_str
in
let s = U_Base64.url_decode header_str in
Result.bind s (fun decoded_header ->
Yojson.Safe.from_string decoded_header |> of_json)
Yojson.Safe.from_string decoded_header |> of_json)

let to_string header =
to_json header |> Yojson.Safe.to_string |> U_Base64.url_encode_string
Loading
Loading