Skip to content

Commit

Permalink
Initial commit, with COSE_Key[Set] support
Browse files Browse the repository at this point in the history
  • Loading branch information
daviddrysdale committed Mar 28, 2021
0 parents commit 65013a3
Show file tree
Hide file tree
Showing 24 changed files with 2,802 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
codecov:
require_ci_to_pass: yes

coverage:
precision: 2
round: down
range: "70...100"

parsers:
gcov:
branch_detection:
conditional: yes
loop: yes
method: no
macro: no

comment: false

ignore:
- "**/build.rs"
- "**/benches/"
- "**/tests/"
- "**/codegen/"
- "**/*_test.rs"
- "**/*tests.rs"
139 changes: 139 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
name: CI
on:
pull_request:
paths-ignore:
- README.md
push:
branches: main
paths-ignore:
- README.md

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly-2020-10-19
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- run: cargo build --release --all

test:
runs-on: ubuntu-latest
strategy:
matrix:
rust:
- stable
- beta
- nightly-2020-10-19
steps:
- uses: actions/checkout@v2
with:
submodules: true
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.rust }}
components: rustfmt
override: true
- run: cargo test --all -- --nocapture

formatting:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-go@v2
- run: go get github.com/campoy/embedmd
- uses: actions/setup-ruby@v1
- run: gem install mdl
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-10-19
override: true
components: rustfmt
- run: cargo fmt --all -- --check
- run: scripts/check-format.sh

clippy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-10-19
override: true
components: rustfmt, clippy
- run: cargo clippy --all-features --all-targets

doc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- run: cargo doc --no-deps --document-private-items

udeps:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-10-19
override: true
components: rustfmt
- uses: actions-rs/[email protected]
with:
crate: cargo-udeps
use-tool-cache: true
version: 0.1.15
- run: cargo udeps

deny:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-10-19
override: true
components: rustfmt
- run: cargo install --locked --version 0.8.5 cargo-deny
- run: cargo deny check

coverage:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
submodules: true
fetch-depth: 0
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: nightly-2020-10-19
override: true
components: rustfmt
- uses: actions-rs/[email protected]
with:
crate: cargo-tarpaulin
use-tool-cache: true
- run: cargo tarpaulin --verbose --ignore-tests --all-features --timeout=600 --out Xml
- name: Upload to codecov.io
run: |
bash <(curl -s https://codecov.io/bash)
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/target
18 changes: 18 additions & 0 deletions .mdl-style.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
all
rule 'MD013', :line_length => 120
rule 'MD007', :indent => 4
exclude_rule 'MD031' # embedmd markers are next to fenced code blocks
exclude_rule 'MD033' # allow inline HTML, esp. <sup>
1 change: 1 addition & 0 deletions .mdlrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
style "#{File.dirname(__FILE__)}/.mdl-style.rb"
9 changes: 9 additions & 0 deletions .rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# See https://github.com/rust-lang/rustfmt/blob/master/Configurations.md
comment_width = 100
format_code_in_doc_comments = true
max_width = 100
normalize_doc_attributes = true
wrap_comments = true
merge_imports = true
imports_layout = "mixed"
edition = "2018"
7 changes: 7 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is the list of significant contributors.
#
# This does not necessarily list everyone who has contributed code,
# especially since many employees of one corporation may be contributing.
# To see the full list of contributors, see the revision history in
# source control.
Google LLC
28 changes: 28 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are
just a few small guidelines you need to follow.

## Contributor License Agreement

Contributions to this project must be accompanied by a Contributor License
Agreement. You (or your employer) retain the copyright to your contribution;
this simply gives us permission to use and redistribute your contributions as
part of the project. Head over to <https://cla.developers.google.com/> to see
your current agreements on file or to sign a new one.

You generally only need to submit a CLA once, so if you've already submitted one
(even if it was for a different project), you probably don't need to do it
again.

## Code reviews

All submissions, including submissions by project members, require review. We
use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more
information on using pull requests.

## Community Guidelines

This project follows [Google's Open Source Community
Guidelines](https://opensource.google/conduct/).
94 changes: 94 additions & 0 deletions Cargo.lock

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

17 changes: 17 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
[package]
name = "coset"
version = "0.1.0"
authors = ["David Drysdale <[email protected]>"]
edition = "2018"
license = "Apache-2.0"
description = "Set of types for supporting COSE"
keywords = ["cryptography", "cose"]
categories = ["cryptography"]

[dependencies]
maplit = "^1.0"
serde_cbor = "^0.11.1"
serde = { version = "^1.0.123", features = ["derive"] }

[dev-dependencies]
hex = "^0.4.2"
Loading

0 comments on commit 65013a3

Please sign in to comment.