Skip to content

Commit

Permalink
1.0 release on stable nom 5 (#8)
Browse files Browse the repository at this point in the history
* ⬆️ upgrade to stable nom

* 🔖 release 1.0.0

* 📝 fix changelog links
  • Loading branch information
liamdawson authored Aug 28, 2019
1 parent 1747b46 commit a345458
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 27 deletions.
8 changes: 5 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch

---

## [0.11.0] - (2019-06-01)
## [1.0.0] - (2019-08-28)

* Upgrade to stable version 5 of nom

---

Expand Down Expand Up @@ -37,8 +39,8 @@ This project adheres to [Semantic Versioning](http://semver.org/) and [Keep a Ch

Initial release.

[Unreleased]: https://github.com/hubauth/authorized_keys/compare/v0.11.0...HEAD
[0.11.0]: https://github.com/hubauth/authorized_keys/compare/v0.10.0...v0.11.0
[Unreleased]: https://github.com/hubauth/authorized_keys/compare/v1.0.0...HEAD
[1.0.0]: https://github.com/hubauth/authorized_keys/compare/v0.10.0...v1.0.0
[0.10.0]: https://github.com/hubauth/authorized_keys/compare/v0.9.0...v0.10.0
[0.9.0]: https://github.com/hubauth/authorized_keys/releases/tag/v0.9.0

Expand Down
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "authorized_keys"
version = "0.11.0"
version = "1.0.0"
authors = ["Liam Dawson <[email protected]>"]
edition = "2018"
description = "Parse and manipulate OpenSSH `authorized_keys` files"
Expand All @@ -17,16 +17,16 @@ is-it-maintained-open-issues = { repository = "hubauth/authorized_keys" }
maintenance = { status = "experimental" }

[dependencies]
nom = "5.0.0-beta2"
nom = "5.0"
data-encoding = { version = "2.1", optional = true }

[features]
default = []
key_encoding = ['data-encoding']

[dev-dependencies]
criterion = "0.2"
spectral = "0.6.0"
criterion = "0.3"
spectral = "0.6"

[[bench]]
name = "parsing"
Expand Down
15 changes: 3 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Parse and manipulate OpenSSH `authorized_keys` files.

```toml
[dependencies]
authorized_keys = "0.11"
authorized_keys = "1.0"
```

## Features
Expand All @@ -28,17 +28,8 @@ authorized_keys = "0.11"
with convenience methods
* Write `authorized_keys` files in the correct format
* One dependency by default (`nom`)
* Also depends on [`data-encoding`] if you want to edit key data as
bytes using convenience methods

## Roadmap

### 1.0

* [x] individual parsing parts tested
* [x] benchmarks
* [x] examples
* [ ] release/stable build of `nom` (current `5.0.0-beta2`)
* Depends on [`data-encoding`] if you want to edit key data as bytes using
convenience methods

## Authors

Expand Down
19 changes: 11 additions & 8 deletions src/openssh/v2/parse/atoms.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use nom::branch::alt;
use nom::bytes::complete::{escaped, is_a, is_not, take, take_while1};
use nom::bytes::complete::{escaped, is_a, is_not, take, take_while1, tag};
use nom::character::complete::{anychar, char, space0};
use nom::combinator::recognizec;
use nom::combinator::{recognizec, value};
use nom::error::{ErrorKind, ParseError};
use nom::multi::count;
use nom::sequence::{delimitedc, pairc};
Expand Down Expand Up @@ -34,12 +34,15 @@ pub(crate) fn identifier(input: &str) -> IResult<&str, &str> {

/// Parse an escapable string.
pub(crate) fn string(input: &str) -> IResult<&str, &str> {
delimitedc(
input,
char('"'),
escaped(is_not(r#"\""#), '\\', anychar),
char('"'),
)
alt((
value("", tag(r#""""#)),
|inner| delimitedc(
inner,
char('"'),
escaped(is_not(r#"\""#), '\\', anychar),
char('"'),
)
))(input)
}

/// Indicates whether the character is a valid base64 body character.
Expand Down

0 comments on commit a345458

Please sign in to comment.