Skip to content

Commit 110b805

Browse files
authored
Merge pull request #2 from uzyn/0.15.1-compatibility
Zig v0.15.1 compatibility
2 parents 30a73d4 + 66374cb commit 110b805

File tree

7 files changed

+16
-12
lines changed

7 files changed

+16
-12
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ jobs:
77
test:
88
strategy:
99
matrix:
10-
zig-version: [0.14.0, master]
10+
zig-version: [0.15.1, master]
1111

1212
name: Ubuntu / Zig ${{ matrix.zig-version }}
1313
runs-on: ubuntu-latest

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66

77
**Minimal**, **fast** and **secure** Passkey (WebAuthn) relying party (RP) library for Zig.
88

9-
Supports both Zig stable 0.14+ and nightly (0.15+).
9+
Zig version support:
10+
1. v2.x - Supports Zig latest stable v0.15
11+
2. v1.x - Supports Zig v0.14
1012

1113
## Features
1214

build.zig

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,11 @@ pub fn build(b: *std.Build) void {
6868
// Creates a step for unit testing. This only builds the test executable
6969
// but does not run it.
7070
const lib_unit_tests = b.addTest(.{
71-
.root_source_file = b.path("src/test_entry.zig"),
72-
.target = target,
73-
.optimize = optimize,
71+
.root_module = b.createModule(.{
72+
.root_source_file = b.path("src/test_entry.zig"),
73+
.target = target,
74+
.optimize = optimize,
75+
}),
7476
});
7577
lib_unit_tests.root_module.addImport("zbor", zbor_mod);
7678

build.zig.zon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// This is a [Semantic Version](https://semver.org/).
1212
// In a future version of Zig it will be used for package deduplication.
13-
.version = "1.0.0",
13+
.version = "2.0.0",
1414

1515
// Together with name, this represents a globally unique package
1616
// identifier. This field is generated by the Zig toolchain when the
@@ -28,7 +28,7 @@
2828

2929
// Tracks the earliest Zig version that the package considers to be a
3030
// supported use case.
31-
.minimum_zig_version = "0.14.0",
31+
.minimum_zig_version = "0.15.1",
3232

3333
// This field is optional.
3434
// Each dependency must either provide a `url` and `hash`, or a `path`.

src/auth.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ test "verify with explicit challenge" {
307307
const test_challenge = "explicit_test_challenge";
308308

309309
// Manually create a JSON string
310-
var client_data = std.ArrayList(u8).init(allocator);
310+
var client_data = std.array_list.Managed(u8).init(allocator);
311311
defer client_data.deinit();
312312
try client_data.appendSlice("{\"type\":\"webauthn.get\",\"challenge\":\"");
313313
try client_data.appendSlice(test_challenge);

src/cbor.zig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ pub fn encodeAttestationObject(
382382
auth_data: []const u8,
383383
att_stmt: []const u8,
384384
) ![]const u8 {
385-
var buffer = std.ArrayList(u8).init(allocator);
385+
var buffer = std.array_list.Managed(u8).init(allocator);
386386
defer buffer.deinit();
387387

388388
try buffer.append(0xA3); // Map, 3 pairs
@@ -457,7 +457,7 @@ pub const AuthData = struct {
457457

458458
test "parseAttestationObject basic functionality" {
459459
const testing = std.testing;
460-
var buffer = std.ArrayList(u8).init(testing.allocator);
460+
var buffer = std.array_list.Managed(u8).init(testing.allocator);
461461
defer buffer.deinit();
462462

463463
try buffer.append(0xA3);
@@ -494,7 +494,7 @@ test "parseCoseKey with EC2/P-256 key" {
494494
const testing = std.testing;
495495

496496
// Create a COSE key for EC2/P-256
497-
var buffer = std.ArrayList(u8).init(testing.allocator);
497+
var buffer = std.array_list.Managed(u8).init(testing.allocator);
498498
defer buffer.deinit();
499499

500500
// Map with 5 entries

src/register.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ test "verify skipping user presence verification" {
385385
key_pos += 1;
386386

387387
// Create attestation object
388-
var attestation_obj = std.ArrayList(u8).init(allocator);
388+
var attestation_obj = std.array_list.Managed(u8).init(allocator);
389389
defer attestation_obj.deinit();
390390

391391
// Map with 3 entries

0 commit comments

Comments
 (0)