Skip to content

Commit b0634d3

Browse files
Here be dragons
Signed-off-by: Florentin Dubois <[email protected]>
0 parents  commit b0634d3

File tree

8 files changed

+1667
-0
lines changed

8 files changed

+1667
-0
lines changed

.github/workflows/ci.yml

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
---
2+
name: Continuous integration
3+
on: [ push, pull_request ]
4+
jobs:
5+
build:
6+
name: Build library
7+
runs-on: ubuntu-latest
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
rust:
12+
- stable
13+
- beta
14+
- nightly
15+
steps:
16+
- uses: actions/checkout@v2
17+
- uses: actions-rs/toolchain@v1
18+
with:
19+
toolchain: ${{ matrix.rust }}
20+
profile: minimal
21+
override: true
22+
- uses: actions-rs/cargo@v1
23+
with:
24+
command: build
25+
args: --verbose --features telemetry --features client
26+
test:
27+
name: Test library
28+
runs-on: ubuntu-latest
29+
strategy:
30+
fail-fast: true
31+
matrix:
32+
rust:
33+
- stable
34+
- beta
35+
- nightly
36+
steps:
37+
- uses: actions/checkout@v2
38+
- uses: actions-rs/toolchain@v1
39+
with:
40+
toolchain: ${{ matrix.rust }}
41+
profile: minimal
42+
override: true
43+
- uses: actions-rs/cargo@v1
44+
with:
45+
command: install
46+
args: cargo-tarpaulin
47+
- uses: actions-rs/cargo@v1
48+
with:
49+
command: tarpaulin
50+
args: --verbose
51+
format:
52+
name: Format source code
53+
runs-on: ubuntu-latest
54+
steps:
55+
- uses: actions/checkout@v2
56+
- uses: actions-rs/toolchain@v1
57+
with:
58+
toolchain: stable
59+
profile: minimal
60+
override: true
61+
- run: rustup component add rustfmt
62+
- uses: actions-rs/cargo@v1
63+
with:
64+
command: fmt
65+
args: --verbose --all -- --check
66+
clippy:
67+
name: Lint source code
68+
runs-on: ubuntu-latest
69+
steps:
70+
- uses: actions/checkout@v2
71+
- uses: actions-rs/toolchain@v1
72+
with:
73+
toolchain: stable
74+
profile: minimal
75+
override: true
76+
- run: rustup component add clippy
77+
- uses: actions-rs/cargo@v1
78+
with:
79+
command: clippy
80+
args: --verbose --features telemetry --features client -- -D warnings
81+
doc:
82+
name: Build documentation
83+
runs-on: ubuntu-latest
84+
steps:
85+
- uses: actions/checkout@v2
86+
- uses: actions-rs/toolchain@v1
87+
with:
88+
toolchain: stable
89+
profile: minimal
90+
override: true
91+
- uses: actions-rs/cargo@v1
92+
with:
93+
command: doc
94+
args: --verbose --features telemetry --features client
95+
...

.gitignore

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
### Rust ###
2+
# Generated by Cargo
3+
# will have compiled files and executables
4+
debug/
5+
target/
6+
7+
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
8+
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
9+
Cargo.lock
10+
11+
# These are backup files generated by rustfmt
12+
**/*.rs.bk
13+
14+
# MSVC Windows builds of rustc generate these, which store debugging information
15+
*.pdb

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the
26+
overall community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards of
42+
acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies when
54+
an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail address,
56+
posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at
63+
64+
All complaints will be reviewed and investigated promptly and fairly.
65+
66+
All community leaders are obligated to respect the privacy and security of the
67+
reporter of any incident.
68+
69+
## Enforcement Guidelines
70+
71+
Community leaders will follow these Community Impact Guidelines in determining
72+
the consequences for any action they deem in violation of this Code of Conduct:
73+
74+
### 1. Correction
75+
76+
**Community Impact**: Use of inappropriate language or other behavior deemed
77+
unprofessional or unwelcome in the community.
78+
79+
**Consequence**: A private, written warning from community leaders, providing
80+
clarity around the nature of the violation and an explanation of why the
81+
behavior was inappropriate. A public apology may be requested.
82+
83+
### 2. Warning
84+
85+
**Community Impact**: A violation through a single incident or series
86+
of actions.
87+
88+
**Consequence**: A warning with consequences for continued behavior. No
89+
interaction with the people involved, including unsolicited interaction with
90+
those enforcing the Code of Conduct, for a specified period of time. This
91+
includes avoiding interactions in community spaces as well as external channels
92+
like social media. Violating these terms may lead to a temporary or
93+
permanent ban.
94+
95+
### 3. Temporary Ban
96+
97+
**Community Impact**: A serious violation of community standards, including
98+
sustained inappropriate behavior.
99+
100+
**Consequence**: A temporary ban from any sort of interaction or public
101+
communication with the community for a specified period of time. No public or
102+
private interaction with the people involved, including unsolicited interaction
103+
with those enforcing the Code of Conduct, is allowed during this period.
104+
Violating these terms may lead to a permanent ban.
105+
106+
### 4. Permanent Ban
107+
108+
**Community Impact**: Demonstrating a pattern of violation of community
109+
standards, including sustained inappropriate behavior, harassment of an
110+
individual, or aggression toward or disparagement of classes of individuals.
111+
112+
**Consequence**: A permanent ban from any sort of public interaction within
113+
the community.
114+
115+
## Attribution
116+
117+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118+
version 2.0, available at
119+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at
128+
https://www.contributor-covenant.org/translations.

Cargo.toml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[package]
2+
name = "oauth10a"
3+
description = "A rust implementation of the oauth 1.0a protocol fully-async with logging, metrics and tracing facilities"
4+
version = "1.0.0"
5+
edition = "2018"
6+
authors = ["Florentin Dubois <[email protected]>"]
7+
license-file = "LICENSE"
8+
readme = "README.md"
9+
keywords = [
10+
"clevercloud",
11+
"client",
12+
"logging",
13+
"metrics",
14+
"oauth1a",
15+
]
16+
17+
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
18+
19+
[dependencies]
20+
async-trait = { version = "^0.1.51", optional = true }
21+
base64 = { version = "^0.13.0", optional = true }
22+
bytes = { version = "^1.1.0", features = ["serde"], optional = true }
23+
hmac = { version = "^0.11.0", features = ["std"], optional = true }
24+
hyper = { version = "^0.14.13", default-features = false, optional = true }
25+
hyper-tls = { version = "^0.5.0", optional = true }
26+
lazy_static = { version = "^1.4.0", optional = true }
27+
log = { version = "^0.4.14", optional = true }
28+
prometheus = { version = "^0.13.0", optional = true }
29+
serde = { version = "^1.0.130", features = ["derive"], optional = true }
30+
serde_json = { version = "^1.0.68", features = [
31+
"preserve_order",
32+
"float_roundtrip",
33+
], optional = true }
34+
sha2 = { version = "^0.9.6", optional = true }
35+
thiserror = { version = "^1.0.29", optional = true }
36+
urlencoding = { version = "^2.1.0", optional = true }
37+
uuid = { version = "^0.8.2", features = ["serde", "v4"], optional = true }
38+
39+
[features]
40+
default = ["client", "logging"]
41+
client = [
42+
"async-trait",
43+
"base64",
44+
"bytes",
45+
"hmac",
46+
"hyper",
47+
"hyper/client",
48+
"hyper/tcp",
49+
"hyper/http1",
50+
"hyper-tls",
51+
"serde",
52+
"serde_json",
53+
"sha2",
54+
"thiserror",
55+
"urlencoding",
56+
"uuid",
57+
]
58+
logging = ["log"]
59+
metrics = ["lazy_static", "prometheus"]

0 commit comments

Comments
 (0)