Skip to content

Commit cdf3c3e

Browse files
committed
feat: add Identity type (#386)
1 parent 6df2881 commit cdf3c3e

File tree

2 files changed

+22
-2
lines changed

2 files changed

+22
-2
lines changed

git-sec/Cargo.toml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "git-sec"
3-
version = "0.0.0"
3+
version = "0.1.0"
44
repository = "https://github.com/Byron/gitoxide"
55
license = "MIT/Apache-2.0"
66
description = "A WIP crate of the gitoxide project providing a shared trust model"
@@ -10,6 +10,11 @@ edition = "2018"
1010
[lib]
1111
doctest = false
1212

13+
[features]
14+
## Data structures implement `serde::Serialize` and `serde::Deserialize`.
15+
serde1 = [ "serde" ]
16+
1317
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
1418

1519
[dependencies]
20+
serde = { version = "1.0.114", optional = true, default-features = false, features = ["derive"] }

git-sec/src/lib.rs

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,16 @@
1-
#![forbid(unsafe_code, rust_2018_idioms)]
1+
#![forbid(unsafe_code)]
2+
#![deny(rust_2018_idioms, missing_docs)]
3+
//! A shared trust model for `gitoxide` crates.
4+
5+
#[derive(PartialEq, Eq, Debug, Hash, Ord, PartialOrd, Clone)]
6+
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
7+
/// An identity for use when authenticating the transport layer.
8+
pub enum Identity {
9+
/// An account based identity
10+
Account {
11+
/// The user's name
12+
username: String,
13+
/// The user's password
14+
password: String,
15+
},
16+
}

0 commit comments

Comments
 (0)