Skip to content

Commit 9679d6b

Browse files
author
Alex Zepeda
committed
Merge branch 'main' into repo-status
2 parents da8059c + cd723b5 commit 9679d6b

File tree

42 files changed

+979
-286
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+979
-286
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
uses: actions-rs/cargo@v1
6262
with:
6363
command: install
64-
args: "gitoxide cargo-smart-release"
64+
args: "--force gitoxide cargo-smart-release"
6565

6666
lint:
6767
runs-on: ubuntu-latest

Cargo.lock

Lines changed: 76 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,10 +146,12 @@ members = [
146146
"git-packetline",
147147
"git-mailmap",
148148
"git-note",
149+
"git-sec",
149150
"git-lfs",
150151
"git-rebase",
151152
"git-submodule",
152153
"git-transport",
154+
"git-credentials",
153155
"git-protocol",
154156
"git-pack",
155157
"git-odb",

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,8 @@ check: ## Build all code in suitable configurations
8989
cd git-object && cargo check --all-features \
9090
&& cargo check --features verbose-object-parsing-errors
9191
cd git-index && cargo check --features serde1
92+
cd git-credentials && cargo check --features serde1
93+
cd git-sec && cargo check --features serde1
9294
cd git-revision && cargo check --features serde1
9395
cd git-attributes && cargo check --features serde1
9496
cd git-glob && cargo check --features serde1

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,12 +121,14 @@ Crates that seem feature complete and need to see some more use before they can
121121
* [git-attributes](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-attributes)
122122
* [git-quote](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-quote)
123123
* **idea**
124+
* [git-credentials](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-credentials)
125+
* [git-sec](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-sec)
124126
* [git-note](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-note)
125127
* [git-date](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-date)
126128
* [git-lfs](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-lfs)
127129
* [git-rebase](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-rebase)
128130
* [git-pathspec](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-pathspec)
129-
* [git-subomdule](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-submodule)
131+
* [git-submodule](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-submodule)
130132
* [git-tui](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-tui)
131133
* [git-tix](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-tix)
132134
* [git-bundle](https://github.com/Byron/gitoxide/blob/main/crate-status.md#git-bundle)

crate-status.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,13 @@ A mechanism to associate metadata with any object, and keep revisions of it usin
233233

234234
### git-date
235235
* [ ] parse git dates
236+
237+
### git-credentials
238+
* [x] launch git credentials helpers with a given action
239+
240+
### git-sec
241+
242+
Provides a trust model to share across gitoxide crates. It helps configuring how to interact with external processes, among other things.
236243

237244
### git-rebase
238245
* [ ] obtain rebase status

etc/check-package-size.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ set -eu -o pipefail
44

55
function enter () {
66
local dir="${1:?need directory to enter}"
7-
echo $' in' $dir
7+
echo -n $' in' $dir $'\t\t'
88
cd $dir
99
}
1010

@@ -36,6 +36,11 @@ echo "in root: gitoxide CLI"
3636
(enter git-traverse && indent cargo diet -n --package-size-limit 10KB)
3737
(enter git-url && indent cargo diet -n --package-size-limit 15KB)
3838
(enter git-validate && indent cargo diet -n --package-size-limit 5KB)
39+
(enter git-date && indent cargo diet -n --package-size-limit 5KB)
40+
(enter git-note && indent cargo diet -n --package-size-limit 5KB)
41+
(enter git-sec && indent cargo diet -n --package-size-limit 5KB)
42+
(enter git-tix && indent cargo diet -n --package-size-limit 5KB)
43+
(enter git-credentials && indent cargo diet -n --package-size-limit 5KB)
3944
(enter git-object && indent cargo diet -n --package-size-limit 25KB)
4045
(enter git-commitgraph && indent cargo diet -n --package-size-limit 25KB)
4146
(enter git-pack && indent cargo diet -n --package-size-limit 115KB)

git-config/Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ include = ["src/**/*", "LICENSE-*", "README.md", "CHANGELOG.md"]
1515

1616
[dependencies]
1717
git-features = { version = "^0.20.0", path = "../git-features"}
18+
git-sec = { version = "^0.1.0", path = "../git-sec" }
19+
1820
dirs = "4"
1921
nom = { version = "7", default_features = false, features = [ "std" ] }
2022
memchr = "2"

git-config/src/lib.rs

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,65 @@ pub mod fs;
5959
pub mod parser;
6060
pub mod values;
6161

62-
// mod de;
63-
// mod ser;
64-
// mod error;
65-
// pub use de::{from_str, Deserializer};
66-
// pub use error::{Error, Result};
67-
// pub use ser::{to_string, Serializer};
62+
mod permissions {
63+
use crate::Permissions;
64+
65+
impl Permissions {
66+
/// Allow everything which usually relates to a fully trusted environment
67+
pub fn all() -> Self {
68+
use git_sec::Permission::*;
69+
Permissions {
70+
system: Allow,
71+
global: Allow,
72+
user: Allow,
73+
repository: Allow,
74+
worktree: Allow,
75+
env: Allow,
76+
includes: Allow,
77+
}
78+
}
79+
80+
/// If in doubt, this configuration can be used to safely load configuration from sources which is usually trusted,
81+
/// that is system and user configuration. Do load any configuration that isn't trusted as it's now owned by the current user.
82+
pub fn secure() -> Self {
83+
use git_sec::Permission::*;
84+
Permissions {
85+
system: Allow,
86+
global: Allow,
87+
user: Allow,
88+
repository: Deny,
89+
worktree: Deny,
90+
env: Allow,
91+
includes: Deny,
92+
}
93+
}
94+
}
95+
}
96+
97+
/// Configure security relevant options when loading a git configuration.
98+
#[derive(Copy, Clone, Ord, PartialOrd, PartialEq, Eq, Debug, Hash)]
99+
#[cfg_attr(feature = "serde1", derive(serde::Serialize, serde::Deserialize))]
100+
pub struct Permissions {
101+
/// How to use the system configuration.
102+
/// This is defined as `$(prefix)/etc/gitconfig` on unix.
103+
pub system: git_sec::Permission,
104+
/// How to use the global configuration.
105+
/// This is usually `~/.gitconfig`.
106+
pub global: git_sec::Permission,
107+
/// How to use the user configuration.
108+
/// Second user-specific configuration path; if `$XDG_CONFIG_HOME` is not
109+
/// set or empty, `$HOME/.config/git/config` will be used.
110+
pub user: git_sec::Permission,
111+
/// How to use the repository configuration.
112+
pub repository: git_sec::Permission,
113+
/// How to use worktree configuration from `config.worktree`.
114+
// TODO: figure out how this really applies and provide more information here.
115+
pub worktree: git_sec::Permission,
116+
/// How to use the configuration from environment variables.
117+
pub env: git_sec::Permission,
118+
/// What to do when include files are encountered in loaded configuration.
119+
pub includes: git_sec::Permission,
120+
}
68121

69122
#[cfg(test)]
70123
pub mod test_util;

git-credentials/CHANGELOG.md

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## 0.0.0 (2022-04-15)
9+
10+
An empty crate without any content to reserve the name for the gitoxide project.
11+
12+
### Commit Statistics
13+
14+
<csr-read-only-do-not-edit/>
15+
16+
- 1 commit contributed to the release.
17+
- 0 commits where understood as [conventional](https://www.conventionalcommits.org).
18+
- 1 unique issue was worked on: [#386](https://github.com/Byron/gitoxide/issues/386)
19+
20+
### Commit Details
21+
22+
<csr-read-only-do-not-edit/>
23+
24+
<details><summary>view details</summary>
25+
26+
* **[#386](https://github.com/Byron/gitoxide/issues/386)**
27+
- add frame for git-credentials crate ([`be7a9cf`](https://github.com/Byron/gitoxide/commit/be7a9cf776f958ac7228457bb4e1415f86f8e575))
28+
</details>
29+

0 commit comments

Comments
 (0)