Skip to content
This repository was archived by the owner on May 13, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,4 @@ vault-api = "0.7.2"
[dev-dependencies]
tempfile = "3.0.5"

[workspace]
[workspace]
2 changes: 2 additions & 0 deletions vault-api/.cargo/config
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ rustflags = [
"-W", "unused_extern_crates", # extern crates that are never used

"-W", "unused_import_braces", # unnecessary braces around an imported item

"-D", "warnings", # all warnings should be denied
]
33 changes: 33 additions & 0 deletions vault-api/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
.cargo/config
.gitignore
Cargo.toml
docs/AuthCertLoginParameters.md
docs/AuthResponse.md
docs/AuthResponseAllOf.md
docs/AuthResponseAllOfAuth.md
docs/CertificateResponse.md
docs/CertificateResponseAllOf.md
docs/CertificateResponseAllOfData.md
docs/CommonResponse.md
docs/CreateTokenParameters.md
docs/GenerateCertificateParameters.md
docs/GenerateCertificateResponse.md
docs/GenerateCertificateResponseAllOf.md
docs/GenerateCertificateResponseAllOfData.md
docs/RenewSelfParameters.md
docs/RevokeLeaseParameters.md
docs/leases_api.md
docs/pki_backend_api.md
docs/token_backend_api.md
examples/ca.pem
examples/client/main.rs
examples/server-chain.pem
examples/server-key.pem
examples/server/main.rs
examples/server/server.rs
src/client/mod.rs
src/context.rs
src/header.rs
src/lib.rs
src/models.rs
src/server/mod.rs
1 change: 1 addition & 0 deletions vault-api/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.0.0-SNAPSHOT
94 changes: 66 additions & 28 deletions vault-api/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,43 +1,81 @@
[package]
name = "vault-api"
version = "0.7.2"
version = "1.0.0"
authors = ["Metaswitch Networks Ltd"]
license = "Apache-2.0/MIT"
description = "Vault API library"
edition = "2018"

[features]
default = ["client", "server"]
client = ["serde_json", "serde_ignored", "hyper", "hyper-openssl", "uuid"]
server = ["serde_json", "serde_ignored", "hyper", "iron", "router", "bodyparser", "urlencoded", "uuid"]
client = [
"hyper", "hyper-openssl", "hyper-tls", "native-tls", "openssl", "url"
]
server = [
"serde_ignored", "hyper", "regex", "percent-encoding", "url", "lazy_static"
]
conversion = ["frunk", "frunk_derives", "frunk_core", "frunk-enum-core", "frunk-enum-derive"]

[target.'cfg(any(target_os = "macos", target_os = "windows", target_os = "ios"))'.dependencies]
native-tls = { version = "0.2", optional = true }
hyper-tls = { version = "0.4", optional = true }

[target.'cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))'.dependencies]
hyper-openssl = { version = "0.8", optional = true }
openssl = {version = "0.10", optional = true }

[dependencies]
# Required by example server.
#
# Common
async-trait = "0.1.24"
chrono = { version = "0.4", features = ["serde"] }
futures = "0.1"
hyper = {version = "0.10", optional = true}
hyper-openssl = {version = "0.2", optional = true }
iron = {version = "0.5", optional = true}
swagger = "0.7"

# Not required by example server.
#
bodyparser = {version = "0.7", optional = true}
url = "1.5"
lazy_static = "0.2"
log = "0.3.0"
multipart = {version = "0.13", optional = true}
router = {version = "0.5", optional = true}
serde = "1.0"
serde_derive = "1.0"
serde_ignored = {version = "0.0.4", optional = true}
serde_json = {version = "1.0", optional = true}
urlencoded = {version = "0.5", optional = true}
uuid = {version = "0.5", optional = true, features = ["serde", "v4"]}
# ToDo: this should be updated to point at the official crate once
# https://github.com/RReverser/serde-xml-rs/pull/45 is accepted upstream
futures = "0.3"
swagger = "5.0.0-alpha-1"
log = "0.4.0"
mime = "0.3"

serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"

# Crates included if required by the API definition

# Common between server and client features
hyper = {version = "0.13", optional = true}
serde_ignored = {version = "0.1.1", optional = true}
url = {version = "2.1", optional = true}

# Client-specific

# Server, and client callback-specific
lazy_static = { version = "1.4", optional = true }
percent-encoding = {version = "2.1.0", optional = true}
regex = {version = "1.3", optional = true}

# Conversion
frunk = { version = "0.3.0", optional = true }
frunk_derives = { version = "0.3.0", optional = true }
frunk_core = { version = "0.3.0", optional = true }
frunk-enum-derive = { version = "0.2.0", optional = true }
frunk-enum-core = { version = "0.2.0", optional = true }

[dev-dependencies]
clap = "2.25"
error-chain = "0.11"
env_logger = "0.7"
tokio = { version = "0.2", features = ["rt-threaded", "macros", "stream"] }
native-tls = "0.2"
tokio-tls = "0.3"

[target.'cfg(not(any(target_os = "macos", target_os = "windows", target_os = "ios")))'.dev-dependencies]
tokio-openssl = "0.4"
openssl = "0.10"

[[example]]
name = "client"
path = "./examples/client/main.rs"
required-features = ["client"]

[[example]]
name = "server"
path = "./examples/server/main.rs"
required-features = ["server"]

[workspace]
15 changes: 8 additions & 7 deletions vault-api/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PACKAGE_NAME=vault-api
SWAGGER_CODEGEN_IMAGE := jimschubert/swagger-codegen-cli
OPENAPI_GENERATOR_IMAGE := openapitools/openapi-generator-cli

.FORCE:
.PHONY: codegen
Expand All @@ -8,10 +8,11 @@ clean:
-rm -r output

Cargo.toml: .FORCE
@echo "Running swagger-codegen for $*..."
@docker pull ${SWAGGER_CODEGEN_IMAGE}
@docker run --rm -u $$(id -u $$USER) -v=${CURDIR}:/src ${SWAGGER_CODEGEN_IMAGE} generate \
-i /src/api/swagger.yaml \
-l rust-server \
@echo "Running openapi-generator for $*..."
@docker pull ${OPENAPI_GENERATOR_IMAGE}
@docker run --rm -u $$(id -u $$USER) -v=${CURDIR}:/src ${OPENAPI_GENERATOR_IMAGE} generate \
-i /src/api/openapi.yaml \
-g rust-server \
-o /src \
--additional-properties packageName=${PACKAGE_NAME}
--additional-properties packageName=${PACKAGE_NAME} \
--skip-validate-spec
File renamed without changes.
2 changes: 1 addition & 1 deletion vault-api/docs/AuthCertLoginParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**name** | **String** | | [optional] [default to null]
**name** | **String** | | [optional] [default to None]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
10 changes: 5 additions & 5 deletions vault-api/docs/AuthResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**request_id** | **String** | | [default to null]
**lease_duration** | **i32** | | [default to null]
**lease_id** | **String** | | [default to null]
**renewable** | **bool** | | [default to null]
**auth** | [***::models::AuthResponseAuth**](AuthResponse_auth.md) | | [optional] [default to null]
**request_id** | **String** | |
**lease_duration** | **isize** | |
**lease_id** | **String** | |
**renewable** | **bool** | |
**auth** | [***models::AuthResponseAllOfAuth**](AuthResponse_allOf_auth.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
10 changes: 10 additions & 0 deletions vault-api/docs/AuthResponseAllOf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# AuthResponseAllOf

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**auth** | [***models::AuthResponseAllOfAuth**](AuthResponse_allOf_auth.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


14 changes: 14 additions & 0 deletions vault-api/docs/AuthResponseAllOfAuth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# AuthResponseAllOfAuth

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**renewable** | **bool** | |
**lease_duration** | **isize** | |
**policies** | **Vec<String>** | |
**accessor** | **String** | |
**client_token** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


10 changes: 5 additions & 5 deletions vault-api/docs/CertificateResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**request_id** | **String** | | [default to null]
**lease_duration** | **i32** | | [default to null]
**lease_id** | **String** | | [default to null]
**renewable** | **bool** | | [default to null]
**data** | [***::models::CertificateResponseData**](CertificateResponse_data.md) | | [optional] [default to null]
**request_id** | **String** | |
**lease_duration** | **isize** | |
**lease_id** | **String** | |
**renewable** | **bool** | |
**data** | [***models::CertificateResponseAllOfData**](CertificateResponse_allOf_data.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
10 changes: 10 additions & 0 deletions vault-api/docs/CertificateResponseAllOf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# CertificateResponseAllOf

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [***models::CertificateResponseAllOfData**](CertificateResponse_allOf_data.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


10 changes: 10 additions & 0 deletions vault-api/docs/CertificateResponseAllOfData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# CertificateResponseAllOfData

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**certificate** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


8 changes: 4 additions & 4 deletions vault-api/docs/CommonResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**request_id** | **String** | | [default to null]
**lease_duration** | **i32** | | [default to null]
**lease_id** | **String** | | [default to null]
**renewable** | **bool** | | [default to null]
**request_id** | **String** | |
**lease_duration** | **isize** | |
**lease_id** | **String** | |
**renewable** | **bool** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
20 changes: 10 additions & 10 deletions vault-api/docs/CreateTokenParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**id** | **String** | | [optional] [default to null]
**policies** | **Vec<String>** | | [optional] [default to null]
**no_parent** | **bool** | | [optional] [default to null]
**no_default_policy** | **bool** | | [optional] [default to null]
**renewable** | **bool** | | [optional] [default to null]
**ttl** | **String** | | [optional] [default to null]
**explicit_max_ttl** | **bool** | | [optional] [default to null]
**display_name** | **String** | | [optional] [default to null]
**num_uses** | **i32** | | [optional] [default to null]
**period** | **String** | | [optional] [default to null]
**id** | **String** | | [optional] [default to None]
**policies** | **Vec<String>** | | [optional] [default to None]
**no_parent** | **bool** | | [optional] [default to None]
**no_default_policy** | **bool** | | [optional] [default to None]
**renewable** | **bool** | | [optional] [default to None]
**ttl** | **String** | | [optional] [default to None]
**explicit_max_ttl** | **bool** | | [optional] [default to None]
**display_name** | **String** | | [optional] [default to None]
**num_uses** | **isize** | | [optional] [default to None]
**period** | **String** | | [optional] [default to None]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
12 changes: 6 additions & 6 deletions vault-api/docs/GenerateCertificateParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**common_name** | **String** | | [default to null]
**alt_names** | **String** | | [optional] [default to null]
**ip_sans** | **String** | | [optional] [default to null]
**ttl** | **String** | | [optional] [default to null]
**format** | **String** | | [optional] [default to null]
**exclude_cn_from_sans** | **bool** | | [optional] [default to null]
**common_name** | **String** | |
**alt_names** | **String** | | [optional] [default to None]
**ip_sans** | **String** | | [optional] [default to None]
**ttl** | **String** | | [optional] [default to None]
**format** | **String** | | [optional] [default to None]
**exclude_cn_from_sans** | **bool** | | [optional] [default to Some(false)]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
10 changes: 5 additions & 5 deletions vault-api/docs/GenerateCertificateResponse.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**request_id** | **String** | | [default to null]
**lease_duration** | **i32** | | [default to null]
**lease_id** | **String** | | [default to null]
**renewable** | **bool** | | [default to null]
**data** | [***::models::GenerateCertificateResponseData**](GenerateCertificateResponse_data.md) | | [optional] [default to null]
**request_id** | **String** | |
**lease_duration** | **isize** | |
**lease_id** | **String** | |
**renewable** | **bool** | |
**data** | [***models::GenerateCertificateResponseAllOfData**](GenerateCertificateResponse_allOf_data.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
10 changes: 10 additions & 0 deletions vault-api/docs/GenerateCertificateResponseAllOf.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# GenerateCertificateResponseAllOf

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**data** | [***models::GenerateCertificateResponseAllOfData**](GenerateCertificateResponse_allOf_data.md) | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


15 changes: 15 additions & 0 deletions vault-api/docs/GenerateCertificateResponseAllOfData.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# GenerateCertificateResponseAllOfData

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**certificate** | **String** | |
**issuing_ca** | **String** | |
**ca_chain** | **Vec<String>** | | [optional] [default to None]
**private_key** | **String** | |
**private_key_type** | **String** | |
**serial_number** | **String** | |

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)


2 changes: 1 addition & 1 deletion vault-api/docs/RenewSelfParameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**increment** | **String** | | [optional] [default to null]
**increment** | **String** | | [optional] [default to None]

[[Back to Model list]](../README.md#documentation-for-models) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md)

Expand Down
Loading