-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6a6006
commit 0c964a7
Showing
4 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: CI | ||
|
||
on: | ||
pull_request: | ||
push: | ||
branches: main | ||
|
||
jobs: | ||
test: | ||
name: Tests | ||
runs-on: macos-14 | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: build the client | ||
run: cargo build -p client | ||
|
||
- name: build and run the authenticating server, allowing clients by cdhash | ||
run: | | ||
cdhash=$(codesign -dvvv target/debug/client 2>&1 | grep CDHash= | sed 's/CDHash=//') | ||
echo $cdhash | ||
echo -n "cdhash H\"" > examples/authenticating/requirements.txt | ||
echo -n $cdhash >> examples/authenticating/requirements.txt | ||
echo \" >> examples/authenticating/requirements.txt | ||
cat examples/authenticating/requirements.txt | ||
cargo b -p authenticating | ||
sudo mkdir -p /Library/PrivilegedHelperTools | ||
sudo cp target/debug/authenticating /Library/PrivilegedHelperTools/com.example.authenticating | ||
sudo cp examples/authenticating/com.example.authenticating.plist /Library/LaunchDaemons/ | ||
sudo launchctl load /Library/LaunchDaemons/com.example.authenticating.plist | ||
- name: verify the echo client can connect when the requirements match | ||
run: | | ||
target/debug/client | grep "Hello there." | ||
- name: stop the server | ||
run: sudo launchctl unload /Library/LaunchDaemons/com.example.authenticating.plist | ||
|
||
- name: build and run the authenticating server, allowing clients by cdhash | ||
run: | | ||
echo "cdhash H\"0000000000000000000000000000000000000000\"" > examples/authenticating/requirements.txt | ||
cargo b -p authenticating | ||
sudo cp target/debug/authenticating /Library/PrivilegedHelperTools/com.example.authenticating | ||
sudo launchctl load /Library/LaunchDaemons/com.example.authenticating.plist | ||
- name: verify the echo client can't connect when the requirements don't match | ||
run: | | ||
target/debug/client | grep -v "Hello there." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
anchor apple generic and certificate leaf[subject.OU] = \"MY_TEAM_ID\" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters