File tree Expand file tree Collapse file tree 5 files changed +53
-35
lines changed Expand file tree Collapse file tree 5 files changed +53
-35
lines changed Original file line number Diff line number Diff line change
1
+ name : Misc
2
+
3
+ on :
4
+ pull_request :
5
+ push :
6
+ tags :
7
+ - ' v*'
8
+ branches : [ main ]
9
+ workflow_dispatch :
10
+
11
+ concurrency :
12
+ group : misc-${{ github.ref }}
13
+ cancel-in-progress : true
14
+
15
+ jobs :
16
+ integration :
17
+ name : Integration tests
18
+ # If starting the example fails at runtime the integration test will
19
+ # be stuck. Try to limit the damage. The value "10" selected arbitrarily.
20
+ timeout-minutes : 10
21
+ strategy :
22
+ matrix :
23
+ os : [ ubuntu-latest, macos-latest ]
24
+ include :
25
+ - os : windows-latest
26
+ windows : true
27
+ runs-on : ${{ matrix.os }}
28
+ steps :
29
+ - uses : actions/checkout@v4
30
+ # If the example doesn't compile the integration test will
31
+ # be stuck. Check for compilation issues earlier to abort the job
32
+ - name : Check if the example compiles
33
+ run : cargo check --example key_storage
34
+ - name : Run integration tests
35
+ run : ./tests/sign-and-verify.sh
36
+ if : ${{ ! matrix.windows }}
37
+ - name : Run integration tests
38
+ run : " .\\ tests\\ sign-and-verify-win.bat"
39
+ if : ${{ matrix.windows }}
Original file line number Diff line number Diff line change 9
9
workflow_dispatch :
10
10
11
11
concurrency :
12
- group : ${{ github.ref }}
12
+ group : rust- ${{ github.ref }}
13
13
cancel-in-progress : true
14
14
15
15
jobs :
67
67
steps :
68
68
- uses : actions/checkout@v4
69
69
- run : cargo install --locked just cargo-deny
70
- - name : Run unit tests
70
+ - name : Run dependencies check
71
71
run : just dependencies
72
72
73
73
lints :
84
84
- run : cargo install --locked just
85
85
- name : Check for lints
86
86
run : just lints
87
-
88
- integration :
89
- name : Integration tests
90
- # If starting the example fails at runtime the integration test will
91
- # be stuck. Try to limit the damage. The value "10" selected arbitrarily.
92
- timeout-minutes : 10
93
- strategy :
94
- matrix :
95
- os : [ ubuntu-latest, macos-latest ]
96
- include :
97
- - os : windows-latest
98
- windows : true
99
- runs-on : ${{ matrix.os }}
100
- steps :
101
- - uses : actions/checkout@v4
102
- # If the example doesn't compile the integration test will
103
- # be stuck. Check for compilation issues earlier to abort the job
104
- - name : Check if the example compiles
105
- run : cargo check --example key_storage
106
- - name : Run integration tests
107
- run : ./tests/sign-and-verify.sh
108
- if : ${{ ! matrix.windows }}
109
- - name : Run integration tests
110
- run : " .\\ tests\\ sign-and-verify-win.bat"
111
- if : ${{ matrix.windows }}
Original file line number Diff line number Diff line change 3
3
# Faster checks need to be executed first for better UX. For example
4
4
5
5
# codespell is very fast. cargo fmt does not need to download crates etc.
6
- check : spelling formatting lints dependencies tests
6
+ check : spelling formatting docs lints dependencies tests
7
7
8
8
# Checks common spelling mistakes
9
9
spelling :
@@ -13,11 +13,11 @@ spelling:
13
13
formatting :
14
14
just --unstable --fmt --check
15
15
# We're using nightly to properly group imports, see .rustfmt.toml
16
- cargo + nightly fmt -- --check
16
+ cargo + nightly fmt --all -- --check
17
17
18
18
# Lints the source code
19
19
lints :
20
- cargo clippy --all -- -D warnings
20
+ cargo clippy --workspace --no-deps -- all-targets -- -D warnings
21
21
22
22
# Checks for issues with dependencies
23
23
dependencies :
@@ -27,6 +27,10 @@ dependencies:
27
27
tests :
28
28
cargo test --all
29
29
30
+ # Build docs for this crate only
31
+ docs :
32
+ cargo doc --no-deps
33
+
30
34
# Checks for commit messages
31
35
check-commits REFS = ' main..':
32
36
#!/usr/bin/env bash
63
67
cargo clippy --fix --allow-staged
64
68
65
69
# fmt must be last as clippy's changes may break formatting
66
- cargo + nightly fmt
70
+ cargo + nightly fmt --all
Original file line number Diff line number Diff line change 1
1
# ssh-agent-lib
2
2
3
- [ ![ CI] ( https://github.com/wiktor-k/ssh-agent-lib/actions/workflows/ci .yml/badge.svg )] ( https://github.com/wiktor-k/ssh-agent-lib/actions/workflows/ci .yml )
3
+ [ ![ CI] ( https://github.com/wiktor-k/ssh-agent-lib/actions/workflows/rust .yml/badge.svg )] ( https://github.com/wiktor-k/ssh-agent-lib/actions/workflows/rust .yml )
4
4
[ ![ Crates.io] ( https://img.shields.io/crates/v/ssh-agent-lib )] ( https://crates.io/crates/ssh-agent-lib )
5
5
6
6
A collection of types for writing custom SSH agents as specified by the [ SSH Agent Protocol Internet Draft] ( https://datatracker.ietf.org/doc/html/draft-miller-ssh-agent ) .
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ struct KeyStorage {
34
34
}
35
35
36
36
impl KeyStorage {
37
- fn identity_index_from_pubkey ( identities : & Vec < Identity > , pubkey : & PublicKey ) -> Option < usize > {
37
+ fn identity_index_from_pubkey ( identities : & [ Identity ] , pubkey : & PublicKey ) -> Option < usize > {
38
38
for ( index, identity) in identities. iter ( ) . enumerate ( ) {
39
39
if & identity. pubkey == pubkey {
40
40
return Some ( index) ;
@@ -69,7 +69,7 @@ impl KeyStorage {
69
69
}
70
70
71
71
fn sign ( & self , sign_request : & SignRequest ) -> Result < Signature , Box < dyn Error > > {
72
- let pubkey: PublicKey = sign_request. pubkey . clone ( ) . try_into ( ) ? ;
72
+ let pubkey: PublicKey = sign_request. pubkey . clone ( ) . into ( ) ;
73
73
74
74
if let Some ( identity) = self . identity_from_pubkey ( & pubkey) {
75
75
match identity. privkey . key_data ( ) {
@@ -121,7 +121,7 @@ impl KeyStorage {
121
121
Ok ( Message :: IdentitiesAnswer ( identities) )
122
122
}
123
123
Message :: RemoveIdentity ( identity) => {
124
- let pubkey: PublicKey = identity. pubkey . try_into ( ) ? ;
124
+ let pubkey: PublicKey = identity. pubkey . into ( ) ;
125
125
self . identity_remove ( & pubkey) ?;
126
126
Ok ( Message :: Success )
127
127
}
You can’t perform that action at this time.
0 commit comments