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

add environment identifier #2

Merged
merged 1 commit into from
Jan 23, 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
19 changes: 19 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: install CDDL and CBOR tooling
run: gem install --user-install cbor-diag cddl
- name: setup PATH
run: echo "$(gem env gempath | cut -d':' -f1)/bin" >> $GITHUB_PATH
- name: check schema and examples
run: make -C matcher-musings
9 changes: 8 additions & 1 deletion matcher-musings/Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,14 @@
Examples := $(wildcard *.json)
Manifest := manifest.cddl

all: $(Manifest) $(Examples)
all: schema examples

.PHONY: schema
schema: $(Manifest)
@cddl $< g 1

.PHONY: examples
examples: $(Manifest) $(Examples)
@for f in $(Examples); do \
echo ">> validating $$f against $<" ; \
cddl $< validate $$f || exit 1 ; \
Expand Down
6 changes: 3 additions & 3 deletions matcher-musings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ claim-id = text / int

```cddl
RV = {
? desc: text
? environment-id: any

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are some tradeoffs. To me any could improve the flexibility. However, usually environment-id is used as a key to index the RV so text might be better.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, I just set it to any out of pure laziness. This needs some refinement, with text as an obvious candidate.

cond: { + claim-id => matcher }
}
```
Expand All @@ -41,7 +41,7 @@ RV = {

```cddl
xRV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
reason: $reason
}
Expand All @@ -54,7 +54,7 @@ $reason /= "insecure"

```cddl
EV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
claims: named-claims
}
Expand Down
6 changes: 3 additions & 3 deletions matcher-musings/manifest.cddl
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,18 @@ named-claims = {
}

RV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
}

EV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
claims: named-claims
}

xRV = {
? desc: text
? environment-id: any
cond: { + claim-id => matcher }
reason: $reason
}
Expand Down