Compare commits

...

37 Commits

Author SHA1 Message Date
Frank Denis 91e3109831
Merge pull request #70 from agember/master
Update Alpine image version to support Rust version requirement
2024-03-05 21:26:34 +01:00
Aaron Gember-Jacobson bdee525553 Update Alpine image version to support Rust version requirement 2024-03-05 19:42:42 +00:00
Frank Denis debdd9b9cc
Merge pull request #37 from xtr3me/master
Update Alpine to fix Cargo issue caused by textwrap
2022-09-21 12:17:35 +02:00
xtr3me 63fa457bae
Update Alpine to fix Cargo issue caused by textwrap 2022-09-21 12:04:40 +02:00
Frank Denis a2fa341679 Clap update 2022-01-03 10:15:15 +01:00
Frank Denis 2efc655a6f Remove unneeded import 2021-10-21 15:47:30 +02:00
Frank Denis 2d712d777d
Merge pull request #31 from jedisct1/dependabot/add-v2-config-file
Upgrade to GitHub-native Dependabot
2021-04-30 16:05:53 +02:00
dependabot-preview[bot] f90d59f7a7
Upgrade to GitHub-native Dependabot 2021-04-29 20:50:32 +00:00
Frank Denis 007b76fdbd
Merge pull request #30 from bstrie/master
Replace deprecated collections::Bound with ops::Bound
2021-03-18 23:26:10 +01:00
bstrie e3829405a7 Replace deprecated collections::Bound with ops::Bound 2021-03-18 17:48:14 -04:00
Frank Denis dd08639f15
Merge pull request #29 from creekorful/fix-alpine-version
docker: fix alpine version
2021-02-05 15:16:18 +01:00
Aloïs Micard b5ea7d8fdd
docker: fix alpine version 2021-02-05 15:09:56 +01:00
Frank Denis 16f4fd52cf Merge branch 'master' of github.com:jedisct1/iptoasn-webservice
* 'master' of github.com:jedisct1/iptoasn-webservice:
  Create ci.yml
2021-01-03 09:58:08 +01:00
Frank Denis 4512fa69a7 Update badge 2021-01-03 09:57:58 +01:00
Frank Denis f344cf97c2
Create ci.yml 2021-01-03 09:56:47 +01:00
Frank Denis d8949d508c Remove Travis 2021-01-03 09:55:57 +01:00
Frank Denis 85deb50eab Don't use a very old alpine linux version 2021-01-03 09:55:38 +01:00
Frank Denis 47d3f560e3 y++ 2021-01-03 09:53:47 +01:00
Frank Denis 5a6d3d0b02 Use clap app_from_crate 2020-08-01 17:37:58 +02:00
Frank Denis 87b06ef77d Bump 2020-08-01 17:34:17 +02:00
Frank Denis b8ce201ae7 Move back to time 0.1, due to hyper 0.10 2020-08-01 17:33:29 +02:00
dependabot-preview[bot] 8e86fb02f2
Update time requirement from 0.1 to 0.2
Updates the requirements on [time](https://github.com/time-rs/time) to permit the latest version.
- [Release notes](https://github.com/time-rs/time/releases)
- [Commits](https://github.com/time-rs/time/compare/0.1.35...v0.2.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-20 04:59:47 +00:00
Frank Denis da3ceb7e92 Update .gitignore 2019-12-04 16:42:00 +01:00
Frank Denis 4e9c11275c Merge branch 'master' of github.com:jedisct1/iptoasn-webservice
* 'master' of github.com:jedisct1/iptoasn-webservice:
  Bump log from 0.4.6 to 0.4.8
2019-12-04 16:41:37 +01:00
Frank Denis 0ddd4efb0e
Merge pull request #22 from jedisct1/dependabot/cargo/log-0.4.8
Bump log from 0.4.6 to 0.4.8
2019-12-04 09:07:14 +01:00
dependabot-preview[bot] ba42dd3742
Bump log from 0.4.6 to 0.4.8
Bumps [log](https://github.com/rust-lang/log) from 0.4.6 to 0.4.8.
- [Release notes](https://github.com/rust-lang/log/releases)
- [Changelog](https://github.com/rust-lang/log/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/log/compare/0.4.6...0.4.8)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-04 04:59:53 +00:00
Frank Denis ff4b312c3e Merge branch 'master' of github.com:jedisct1/iptoasn-webservice
* 'master' of github.com:jedisct1/iptoasn-webservice:
  Bump horrorshow from 0.6.6 to 0.7.0
  Bump serde_json from 1.0.39 to 1.0.42
2019-12-03 17:49:44 +01:00
Frank Denis 584b0ca9e7
Merge pull request #17 from jedisct1/dependabot/cargo/horrorshow-0.7.0
Bump horrorshow from 0.6.6 to 0.7.0
2019-12-03 17:49:26 +01:00
Frank Denis 66fba5987a Update horrowshow 2019-12-03 17:49:10 +01:00
Frank Denis 32a804cd8d
Merge pull request #16 from jedisct1/dependabot/cargo/serde_json-1.0.42
Bump serde_json from 1.0.39 to 1.0.42
2019-12-03 17:23:02 +01:00
dependabot-preview[bot] 9c80aee3de
Bump horrorshow from 0.6.6 to 0.7.0
Bumps [horrorshow](https://github.com/Stebalien/horrorshow-rs) from 0.6.6 to 0.7.0.
- [Release notes](https://github.com/Stebalien/horrorshow-rs/releases)
- [Commits](https://github.com/Stebalien/horrorshow-rs/compare/v0.6.6...v0.7.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-03 16:00:32 +00:00
dependabot-preview[bot] 9d46adc3e0
Bump serde_json from 1.0.39 to 1.0.42
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.39 to 1.0.42.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.39...v1.0.42)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-12-03 16:00:09 +00:00
Frank Denis 3bf5aa5ec4
Update README.md 2019-06-19 13:49:35 +02:00
Frank Denis f943be0100 Return Expires: headers 2019-05-26 17:32:30 +02:00
Frank Denis f339052e8c Switch to Rust 2018 2019-04-03 01:58:51 +02:00
Frank Denis e854072dbb Update deps 2019-04-03 01:56:32 +02:00
Frank Denis 1e4974b0d6 Add fakeroot to travis 2019-02-18 15:51:14 +01:00
16 changed files with 87 additions and 1240 deletions

8
.github/dependabot.yml vendored Normal file
View File

@ -0,0 +1,8 @@
version: 2
updates:
- package-ecosystem: cargo
directory: "/"
schedule:
interval: daily
time: "04:00"
open-pull-requests-limit: 10

22
.github/workflows/ci.yml vendored Normal file
View File

@ -0,0 +1,22 @@
name: Rust
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
CARGO_TERM_COLOR: always
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose

4
.gitignore vendored
View File

@ -1,3 +1,3 @@
# Generated by Cargo *~
# will have compiled files and executables Cargo.lock
/target/ /target/

View File

@ -1,64 +0,0 @@
language: rust
cache: cargo
env:
global:
- PROJECT_NAME=iptoasn-webservice
- MAKE_DEB=yes
- DEB_MAINTAINER="Frank Denis <github@pureftpd.org>"
- DEB_DESCRIPTION="Webservice for the iptoasn.com database"
matrix:
include:
- os: linux
rust: nightly
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
rust: stable
env: TARGET=x86_64-unknown-linux-gnu
allow_failures:
# TODO You might need to allow failures for some target on some channel for some reason. Below
# there's one (commented out) example of how to do that. Just change the OS, channel and TARGET
# as needed.
# - os: linux
# rust: nightly
# env: TARGET=x86_64-unknown-linux-gnu
before_install:
- export PATH="$PATH:$HOME/.cargo/bin"
install:
- bash ci/install.sh
script:
- bash ci/script.sh
before_deploy:
- bash ci/before_deploy.sh
deploy:
provider: releases
api_key:
secure: 0Y8ZXOJaNJJ5/0IRcXyNIOJK4EICQDRtaB/E+pboNUchJn9fThGMQc2QtZaGddBNrnuHsftBFM7mWXJvZ2H9YGgbBl1N6Z2y33vawSPgzTnfz0CZRJfX1Gl6IdtDH9zvlblHI1aE4eJ6lAu0q8VQ874CBPxoIlzU9jArOTdvyPT+8t64Y0K240trfqrm0NHloUbZtm+HeRJqoK1RKE4kdrpESIVMyyq67fM9T0VqLg+x3OHeQ/itFnZpjqtVtj9WhZeKM6iTNLQT+vLpRAvq8w6sv1WeCMYAqdXUL7jQnVaI+MiepC9z8OoF0ZAYes0I+3aaNsgMHiuwkW+nDUcQp5XLDW3oCq/uST4pN2ki/AJPy4UUUx++xb8SgtKE4wzBGbT0u5yO9JkIPxJZRLy+E0IvTlqVEZL/tvnI09JQQmzgDdP1hCcxpxBBm4xLi/2qSHIJIMUbb92DRwOrTii34+C0oa1UZKh2P/ceCtLNOlOCmFAcWE9uAxjEGP903mmgbixj8xBbyuROedHIMxag0Jr9Tdoi0hsVdhOEss4JjNKf7ayjepRIw5lNFjxk+jgB+Om0J3vQ+i83LxX1a0b9YV+KJUtWz/CV43mwYhF+jh2GAMe0/cvNCbFT4au0SW2FKDvV/00AJ5tPGimVXNe0e+AUqjbJ2sRpylIQw1Mfl6Y=
file_glob: true
file: ${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.*
# don't delete the artifacts from previous phases
skip_cleanup: true
# deploy when a new tag is pushed
on:
condition: $TRAVIS_RUST_VERSION = nightly
tags: true
branches:
only:
# Pushes and PR to the master branch
- master
# IMPORTANT Ruby regex to match tags. Required, or travis won't trigger deploys when a new tag
# is pushed. This regex matches semantic versions like v1.2.3-rc4+2016.02.22
- /^\d+\.\d+\.\d+.*$/
notifications:
email:
on_success: change

887
Cargo.lock generated
View File

@ -1,887 +0,0 @@
[[package]]
name = "MacTypes-sys"
version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "adler32"
version = "1.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "ansi_term"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "antidote"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "atty"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "autocfg"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "base64"
version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "bitflags"
version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "build_const"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "byteorder"
version = "1.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cc"
version = "1.0.29"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "cfg-if"
version = "0.1.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "clap"
version = "2.32.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "cloudabi"
version = "0.0.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "conduit-mime-types"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core-foundation"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "core-foundation-sys"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crc"
version = "1.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "crc32fast"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "error"
version = "0.1.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "flate2"
version = "1.0.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"crc32fast 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz_oxide_c_api 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "foreign-types"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "foreign-types-shared"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "fuchsia-cprng"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "horrorshow"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "httparse"
version = "1.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "hyper"
version = "0.10.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)",
"httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)",
"traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "hyper-native-tls"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)",
"native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "idna"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",
"unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "iptoasn-webservice"
version = "0.2.3"
dependencies = [
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)",
"horrorshow 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper-native-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"iron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"router 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)",
"unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "iron"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"conduit-mime-types 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)",
"error 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)",
"hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)",
"plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
"typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "itoa"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "language-tags"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
version = "1.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "libc"
version = "0.2.48"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "log"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "log"
version = "0.4.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "matches"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "mime"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "miniz-sys"
version = "0.1.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "miniz_oxide"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "miniz_oxide_c_api"
version = "0.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)",
"crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"miniz_oxide 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "modifier"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "native-tls"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)",
"schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "num_cpus"
version = "1.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl"
version = "0.10.16"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "openssl-probe"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "openssl-sys"
version = "0.9.40"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)",
"vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "percent-encoding"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "pkg-config"
version = "0.3.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "plugin"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand"
version = "0.6.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_jitter 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_os 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_chacha"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_core"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rand_hc"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_isaac"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_jitter"
version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_os"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
"fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_pcg"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rand_xorshift"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rdrand"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "redox_syscall"
version = "0.1.51"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "redox_termios"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "remove_dir_all"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "route-recognizer"
version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "router"
version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"iron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"route-recognizer 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
"url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "rustc-serialize"
version = "0.3.24"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "rustc_version"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "ryu"
version = "0.2.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "safemem"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "schannel"
version = "0.1.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "security-framework"
version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "security-framework-sys"
version = "0.2.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"MacTypes-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "semver"
version = "0.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "semver-parser"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde"
version = "1.0.88"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "serde_json"
version = "1.0.38"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "smallvec"
version = "0.6.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "strsim"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "tempfile"
version = "3.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
"remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "termion"
version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "textwrap"
version = "0.10.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "time"
version = "0.1.42"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)",
"redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "traitobject"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "typeable"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "typemap"
version = "0.3.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicase"
version = "1.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-bidi"
version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-normalization"
version = "0.1.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "unicode-width"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "unsafe-any"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "url"
version = "1.7.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)",
"percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "vcpkg"
version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "vec_map"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "version_check"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi"
version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "winapi-i686-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
[metadata]
"checksum MacTypes-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eaf9f0d0b1cc33a4d2aee14fb4b2eac03462ef4db29c8ac4057327d8a71ad86f"
"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c"
"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b"
"checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5"
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
"checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799"
"checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643"
"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12"
"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39"
"checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb"
"checksum cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4390a3b5f4f6bce9c1d0c00128379df433e53777fdd30e92f16a529332baec4e"
"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4"
"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e"
"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f"
"checksum conduit-mime-types 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "95ca30253581af809925ef68c2641cc140d6183f43e12e0af4992d53768bd7b8"
"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980"
"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa"
"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb"
"checksum crc32fast 1.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e91d5240c6975ef33aeb5f148f35275c25eda8e8a5f95abe421978b05b8bf192"
"checksum error 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e606f14042bb87cc02ef6a14db6c90ab92ed6f62d87e69377bc759fd7987cc"
"checksum flate2 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2291c165c8e703ee54ef3055ad6188e3d51108e2ded18e9f2476e774fc5ad3d4"
"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
"checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba"
"checksum horrorshow 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2597ee61238cfe666fe1d1b0fd80eb2bdf9c7999adb8e67cc395d63f17902143"
"checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83"
"checksum hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "df0caae6b71d266b91b4a83111a61d2b94ed2e2bea024c532b933dcff867e58c"
"checksum hyper-native-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d375598f442742b0e66208ee12501391f1c7ac0bafb90b4fe53018f81f06068"
"checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e"
"checksum iron 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2440ae846e7a8c7f9b401db8f6e31b4ea5e7d3688b91761337da7e054520c75b"
"checksum itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1306f3464951f30e30d12373d31c79fbd52d236e5e896fd92f96ec7babbbe60b"
"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1"
"checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047"
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
"checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6"
"checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08"
"checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0"
"checksum miniz-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "0300eafb20369952951699b68243ab4334f4b10a88f411c221d444b36c40e649"
"checksum miniz_oxide 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c468f2369f07d651a5d0bb2c9079f8488a66d5466efe42d0c5c6466edcb7f71e"
"checksum miniz_oxide_c_api 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fe927a42e3807ef71defb191dc87d4e24479b221e67015fe38ae2b7b447bab"
"checksum modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58"
"checksum native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8e08de0070bbf4c31f452ea2a70db092f36f6f2e4d897adf5674477d488fb2"
"checksum num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a23f0ed30a54abaa0c7e83b1d2d87ada7c3c23078d1d87815af3e3b6385fbba"
"checksum openssl 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "ec7bd7ca4cce6dbdc77e7c1230682740d307d1218a87fb0349a571272be749f9"
"checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
"checksum openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)" = "1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c"
"checksum plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0"
"checksum rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca"
"checksum rand_chacha 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef"
"checksum rand_core 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b"
"checksum rand_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d0e7a549d590831370895ab7ba4ea0c1b6b011d106b5ff2da6eee112615e6dc0"
"checksum rand_hc 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4"
"checksum rand_isaac 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08"
"checksum rand_jitter 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7b9ea758282efe12823e0d952ddb269d2e1897227e464919a554f2a03ef1b832"
"checksum rand_os 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b7c690732391ae0abafced5015ffb53656abfaec61b342290e5eb56b286a679d"
"checksum rand_pcg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "086bd09a33c7044e56bb44d5bdde5a60e7f119a9e95b0775f545de759a32fe05"
"checksum rand_xorshift 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c"
"checksum rdrand 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2"
"checksum redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)" = "423e376fffca3dfa06c9e9790a9ccd282fafb3cc6e6397d01dbf64f9bacc6b85"
"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76"
"checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5"
"checksum route-recognizer 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "cf3255338088df8146ba63d60a9b8e3556f1146ce2973bc05a75181a42ce2256"
"checksum router 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b9b1797ff166029cb632237bb5542696e54961b4cf75a324c6f05c9cf0584e4e"
"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda"
"checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a"
"checksum ryu 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "eb9e9b8cde282a9fe6a42dd4681319bfb63f121b8a8ee9439c6f4107e58a46f7"
"checksum safemem 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8dca453248a96cb0749e36ccdfe2b0b4e54a61bfef89fb97ec621eb8e0a93dd9"
"checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56"
"checksum security-framework 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfab8dda0e7a327c696d893df9ffa19cadc4bd195797997f5223cf5831beaf05"
"checksum security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3d6696852716b589dff9e886ff83778bb635150168e83afa8ac6b8a78cb82abc"
"checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403"
"checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3"
"checksum serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "9f301d728f2b94c9a7691c90f07b0b4e8a4517181d9461be94c04bddeb4bd850"
"checksum serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "27dce848e7467aa0e2fcaf0a413641499c0b745452aaca1194d24dedde9e13c9"
"checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be"
"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550"
"checksum tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b86c784c88d98c801132806dadd3819ed29d8600836c4088e855cdf3e178ed8a"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6"
"checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f"
"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079"
"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887"
"checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6"
"checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33"
"checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5"
"checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426"
"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526"
"checksum unsafe-any 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f30360d7979f5e9c6e6cea48af192ea8fab4afb3cf72597154b8f08935bc9c7f"
"checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a"
"checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d"
"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a"
"checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd"
"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0"
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6"
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"

View File

@ -1,24 +1,26 @@
[package] [package]
name = "iptoasn-webservice" name = "iptoasn-webservice"
description = "API server for iptoasn.com" description = "API server for iptoasn.com"
version = "0.2.3" version = "0.2.5"
homepage = "https://iptoasn.com" homepage = "https://iptoasn.com"
repository = "https://github.com/jedisct1/iptoasn-webservice" repository = "https://github.com/jedisct1/iptoasn-webservice"
keywords = ["ip", "asn", "bgp"] keywords = ["ip", "asn", "bgp"]
license = "MIT" license = "MIT"
authors = ["Frank Denis <github@pureftpd.org>"] authors = ["Frank Denis <github@pureftpd.org>"]
edition = "2018"
[dependencies] [dependencies]
clap = "2" clap = { version = "3.0.0", features = ["std", "cargo", "wrap_help"] }
flate2 = "1" flate2 = "1"
horrorshow = "0.6" horrorshow = "0.8"
hyper = "0.10" hyper = "0.10"
hyper-native-tls = "0.3" hyper-native-tls = "0.3"
iron = "0.5" iron = "0.6"
log = "0.4" log = "0.4"
router = "0.5" router = "0.6"
serde_json = "1.0" serde_json = "1.0"
unicase = "1" unicase = "1"
time = "0.1"
[features] [features]
default = [] default = []

View File

@ -1,6 +1,6 @@
BSD 2-Clause License BSD 2-Clause License
Copyright (c) 2016-2019, Frank Denis Copyright (c) 2016-2021, Frank Denis
All rights reserved. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without

View File

@ -1,4 +1,4 @@
[![Build Status](https://travis-ci.org/jedisct1/iptoasn-webservice.svg?branch=master)](https://travis-ci.org/jedisct1/iptoasn-webservice) ![Build Status](https://github.com/jedisct1/iptoasn-webservice/workflows/Rust/badge.svg)
# iptoasn-webservice # iptoasn-webservice
@ -11,7 +11,7 @@ Requires [rust](https://www.rust-lang.org/).
# Usage: # Usage:
```sh ```sh
$ curl https://api.iptoasn.com/v1/as/ip/<ip address> $ curl -H'Accept: application/json' https://api.iptoasn.com/v1/as/ip/<ip address>
``` ```
```json ```json
{ {

View File

@ -1,69 +0,0 @@
# `before_deploy` phase: here we package the build artifacts
set -ex
. $(dirname $0)/utils.sh
# Generate artifacts for release
mk_artifacts() {
cargo build --target $TARGET --release
}
mk_tarball() {
# create a "staging" directory
local td=$(mktempd)
local out_dir=$(pwd)
# TODO update this part to copy the artifacts that make sense for your project
# NOTE All Cargo build artifacts will be under the 'target/$TARGET/{debug,release}'
cp target/$TARGET/release/iptoasn-webservice $td
dostrip $td/iptoasn-webservice
pushd $td
# release tarball will look like 'rust-everywhere-v1.2.3-x86_64-unknown-linux-gnu.tar.gz'
tar czf $out_dir/${PROJECT_NAME}-${TRAVIS_TAG}-${TARGET}.tar.gz *
popd
rm -r $td
}
# Package your artifacts in a .deb file
# NOTE right now you can only package binaries using the `dobin` command. Simply call
# `dobin [file..]` to include one or more binaries in your .deb package. I'll add more commands to
# install other things like manpages (`doman`) as the needs arise.
# XXX This .deb packaging is minimal -- just to make your app installable via `dpkg` -- and doesn't
# fully conform to Debian packaging guideliens (`lintian` raises a few warnings/errors)
mk_deb() {
# TODO update this part to package the artifacts that make sense for your project
dobin target/$TARGET/release/iptoasn-webservice
}
main() {
mk_artifacts
mk_tarball
if [ $TRAVIS_OS_NAME = linux ]; then
if [ ! -z $MAKE_DEB ]; then
dtd=$(mktempd)
mkdir -p $dtd/debian/usr/bin
mk_deb
mkdir -p $dtd/debian/DEBIAN
cat >$dtd/debian/DEBIAN/control <<EOF
Package: $PROJECT_NAME
Version: ${TRAVIS_TAG#v}
Architecture: $(architecture $TARGET)
Maintainer: $DEB_MAINTAINER
Description: $DEB_DESCRIPTION
EOF
fakeroot dpkg-deb --build $dtd/debian
mv $dtd/debian.deb $PROJECT_NAME-$TRAVIS_TAG-$TARGET.deb
rm -r $dtd
fi
fi
}
main

View File

@ -1,57 +0,0 @@
# `install` phase: install stuff needed for the `script` phase
set -ex
. $(dirname $0)/utils.sh
install_c_toolchain() {
case $TARGET in
aarch64-unknown-linux-gnu)
sudo apt-get install -y --no-install-recommends \
gcc-aarch64-linux-gnu libc6-arm64-cross libc6-dev-arm64-cross
;;
*)
# For other targets, this is handled by addons.apt.packages in .travis.yml
;;
esac
}
install_rustup() {
curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain=$TRAVIS_RUST_VERSION
rustc -V
cargo -V
}
install_standard_crates() {
if [ $(host) != "$TARGET" ]; then
rustup target add $TARGET
fi
}
configure_cargo() {
local prefix=$(gcc_prefix)
if [ ! -z $prefix ]; then
# information about the cross compiler
${prefix}gcc -v
# tell cargo which linker to use for cross compilation
mkdir -p .cargo
cat >>.cargo/config <<EOF
[target.$TARGET]
linker = "${prefix}gcc"
EOF
fi
}
main() {
install_c_toolchain
install_rustup
install_standard_crates
configure_cargo
# TODO if you need to install extra stuff add it here
}
main

View File

@ -1,40 +0,0 @@
# `script` phase: you usually build, test and generate docs in this phase
set -ex
. $(dirname $0)/utils.sh
# TODO modify this function as you see fit
# PROTIP Always pass `--target $TARGET` to cargo commands, this makes cargo output build artifacts
# to target/$TARGET/{debug,release} which can reduce the number of needed conditionals in the
# `before_deploy`/packaging phase
run_test_suite() {
case $TARGET in
# configure emulation for transparent execution of foreign binaries
aarch64-unknown-linux-gnu)
export QEMU_LD_PREFIX=/usr/aarch64-linux-gnu
;;
arm*-unknown-linux-gnueabihf)
export QEMU_LD_PREFIX=/usr/arm-linux-gnueabihf
;;
*)
;;
esac
if [ ! -z "$QEMU_LD_PREFIX" ]; then
# Run tests on a single thread when using QEMU user emulation
export RUST_TEST_THREADS=1
fi
cargo build --target $TARGET --verbose
cargo test --target $TARGET
# sanity check the file type
file target/$TARGET/debug/iptoasn-webservice
}
main() {
run_test_suite
}
main

View File

@ -1,71 +0,0 @@
mktempd() {
echo $(mktemp -d 2>/dev/null || mktemp -d -t tmp)
}
host() {
case "$TRAVIS_OS_NAME" in
linux)
echo x86_64-unknown-linux-gnu
;;
osx)
echo x86_64-apple-darwin
;;
esac
}
gcc_prefix() {
case "$TARGET" in
aarch64-unknown-linux-gnu)
echo aarch64-linux-gnu-
;;
arm*-gnueabihf)
echo arm-linux-gnueabihf-
;;
*-musl)
echo musl-
;;
*)
return
;;
esac
}
dostrip() {
local stu=strip prefix=$(gcc_prefix)
if which ${prefix}strip > /dev/null; then
stu=${prefix}strip
fi
if strip --version 2>/dev/null | fgrep GNU >/dev/null ; then
$stu -s $1
else
$stu $1
fi
}
dobin() {
[ -z $MAKE_DEB ] && die 'dobin: $MAKE_DEB not set'
[ $# -lt 1 ] && die "dobin: at least one argument needed"
local f prefix=$(gcc_prefix)
for f in "$@"; do
install -m0755 $f $dtd/debian/usr/bin/
dostrip $dtd/debian/usr/bin/$(basename $f)
done
}
architecture() {
case $1 in
x86_64-unknown-linux-gnu|x86_64-unknown-linux-musl)
echo amd64
;;
i686-unknown-linux-gnu|i686-unknown-linux-musl)
echo i386
;;
arm*-unknown-linux-gnueabihf)
echo armhf
;;
*)
die "architecture: unexpected target $TARGET"
;;
esac
}

View File

@ -1,4 +1,4 @@
FROM alpine:3.7 FROM alpine:3.17.7
COPY Cargo.* /tmp/iptoasn/ COPY Cargo.* /tmp/iptoasn/
COPY src /tmp/iptoasn/src COPY src /tmp/iptoasn/src

View File

@ -4,9 +4,9 @@ use hyper::{self, Client};
use hyper_native_tls::NativeTlsClient; use hyper_native_tls::NativeTlsClient;
use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd}; use std::cmp::{Eq, Ord, Ordering, PartialEq, PartialOrd};
use std::collections::BTreeSet; use std::collections::BTreeSet;
use std::collections::Bound::{Included, Unbounded};
use std::io::prelude::*; use std::io::prelude::*;
use std::net::IpAddr; use std::net::IpAddr;
use std::ops::Bound::{Included, Unbounded};
use std::str::FromStr; use std::str::FromStr;
#[derive(Debug)] #[derive(Debug)]

View File

@ -1,26 +1,21 @@
extern crate clap;
extern crate flate2;
#[macro_use] #[macro_use]
extern crate horrorshow; extern crate horrorshow;
extern crate hyper;
extern crate hyper_native_tls;
extern crate iron;
#[macro_use] #[macro_use]
extern crate log; extern crate log;
#[macro_use] #[macro_use]
extern crate router; extern crate router;
extern crate serde_json; #[macro_use]
extern crate unicase; extern crate clap;
mod asns; mod asns;
mod webservice; mod webservice;
use asns::*; use crate::asns::*;
use clap::{App, Arg}; use crate::webservice::*;
use clap::Arg;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use std::thread; use std::thread;
use std::time::Duration; use std::time::Duration;
use webservice::*;
fn get_asns(db_url: &str) -> Result<ASNs, &'static str> { fn get_asns(db_url: &str) -> Result<ASNs, &'static str> {
info!("Retrieving ASNs"); info!("Retrieving ASNs");
@ -41,13 +36,10 @@ fn update_asns(asns_arc: &Arc<RwLock<Arc<ASNs>>>, db_url: &str) {
} }
fn main() { fn main() {
let matches = App::new("iptoasn webservice") let matches = app_from_crate!()
.version("0.2.0")
.author("Frank Denis")
.about("Webservice for https://iptoasn.com")
.arg( .arg(
Arg::with_name("listen_addr") Arg::new("listen_addr")
.short("l") .short('l')
.long("listen") .long("listen")
.value_name("ip:port") .value_name("ip:port")
.help("Webservice IP and port") .help("Webservice IP and port")
@ -55,8 +47,8 @@ fn main() {
.default_value("0.0.0.0:53661"), .default_value("0.0.0.0:53661"),
) )
.arg( .arg(
Arg::with_name("db_url") Arg::new("db_url")
.short("u") .short('u')
.long("dburl") .long("dburl")
.value_name("url") .value_name("url")
.help("URL of the gzipped database") .help("URL of the gzipped database")

View File

@ -1,16 +1,17 @@
use asns::*; use crate::asns::*;
use horrorshow::prelude::*; use horrorshow::prelude::*;
use iron::headers::{Accept, CacheControl, CacheDirective, Vary}; use iron::headers::{Accept, CacheControl, CacheDirective, Expires, HttpDate, Vary};
use iron::mime::*; use iron::mime::*;
use iron::modifiers::Header; use iron::modifiers::Header;
use iron::prelude::*; use iron::prelude::*;
use iron::status; use iron::status;
use iron::{typemap, BeforeMiddleware}; use iron::{typemap, BeforeMiddleware};
use router::Router; use router::Router;
use serde_json;
use std::net::IpAddr; use std::net::IpAddr;
use std::str::FromStr; use std::str::FromStr;
use std::sync::{Arc, RwLock}; use std::sync::{Arc, RwLock};
use time::{self, Duration};
use unicase::UniCase; use unicase::UniCase;
const TTL: u32 = 86_400; const TTL: u32 = 86_400;
@ -30,7 +31,7 @@ impl ASNsMiddleware {
} }
impl BeforeMiddleware for ASNsMiddleware { impl BeforeMiddleware for ASNsMiddleware {
fn before(&self, req: &mut Request) -> IronResult<()> { fn before(&self, req: &mut Request<'_, '_>) -> IronResult<()> {
req.extensions req.extensions
.insert::<ASNsMiddleware>(self.asns_arc.read().unwrap().clone()); .insert::<ASNsMiddleware>(self.asns_arc.read().unwrap().clone());
Ok(()) Ok(())
@ -45,7 +46,7 @@ enum OutputType {
pub struct WebService; pub struct WebService;
impl WebService { impl WebService {
fn index(_: &mut Request) -> IronResult<Response> { fn index(_: &mut Request<'_, '_>) -> IronResult<Response> {
Ok(Response::with(( Ok(Response::with((
status::Ok, status::Ok,
Mime( Mime(
@ -57,11 +58,14 @@ impl WebService {
CacheDirective::Public, CacheDirective::Public,
CacheDirective::MaxAge(TTL), CacheDirective::MaxAge(TTL),
])), ])),
Header(Expires(HttpDate(
time::now() + Duration::seconds(TTL.into()),
))),
"See https://iptoasn.com", "See https://iptoasn.com",
))) )))
} }
fn accept_type(req: &Request) -> OutputType { fn accept_type(req: &Request<'_, '_>) -> OutputType {
let mut output_type = OutputType::Json; let mut output_type = OutputType::Json;
if let Some(header_accept) = req.headers.get::<Accept>() { if let Some(header_accept) = req.headers.get::<Accept>() {
for header in header_accept.iter() { for header in header_accept.iter() {
@ -83,7 +87,7 @@ impl WebService {
fn output_json( fn output_json(
map: &serde_json::Map<String, serde_json::value::Value>, map: &serde_json::Map<String, serde_json::value::Value>,
cache_header: Header<CacheControl>, cache_headers: (Header<CacheControl>, Header<Expires>),
vary_header: Header<Vary>, vary_header: Header<Vary>,
) -> IronResult<Response> { ) -> IronResult<Response> {
let json = serde_json::to_string(&map).unwrap(); let json = serde_json::to_string(&map).unwrap();
@ -95,7 +99,8 @@ impl WebService {
Ok(Response::with(( Ok(Response::with((
status::Ok, status::Ok,
mime_json, mime_json,
cache_header, cache_headers.0,
cache_headers.1,
vary_header, vary_header,
json, json,
))) )))
@ -103,7 +108,7 @@ impl WebService {
fn output_html( fn output_html(
map: &serde_json::Map<String, serde_json::value::Value>, map: &serde_json::Map<String, serde_json::value::Value>,
cache_header: Header<CacheControl>, cache_headers: (Header<CacheControl>, Header<Expires>),
vary_header: Header<Vary>, vary_header: Header<Vary>,
) -> IronResult<Response> { ) -> IronResult<Response> {
let mime_html = Mime( let mime_html = Mime(
@ -165,7 +170,8 @@ impl WebService {
Ok(Response::with(( Ok(Response::with((
status::Ok, status::Ok,
mime_html, mime_html,
cache_header, cache_headers.0,
cache_headers.1,
vary_header, vary_header,
html, html,
))) )))
@ -174,25 +180,30 @@ impl WebService {
fn output( fn output(
output_type: &OutputType, output_type: &OutputType,
map: &serde_json::Map<String, serde_json::value::Value>, map: &serde_json::Map<String, serde_json::value::Value>,
cache_header: Header<CacheControl>, cache_headers: (Header<CacheControl>, Header<Expires>),
vary_header: Header<Vary>, vary_header: Header<Vary>,
) -> IronResult<Response> { ) -> IronResult<Response> {
match *output_type { match *output_type {
OutputType::Json => Self::output_json(map, cache_header, vary_header), OutputType::Json => Self::output_json(map, cache_headers, vary_header),
_ => Self::output_html(map, cache_header, vary_header), _ => Self::output_html(map, cache_headers, vary_header),
} }
} }
fn ip_lookup(req: &mut Request) -> IronResult<Response> { fn ip_lookup(req: &mut Request<'_, '_>) -> IronResult<Response> {
let mime_text = Mime( let mime_text = Mime(
TopLevel::Text, TopLevel::Text,
SubLevel::Plain, SubLevel::Plain,
vec![(Attr::Charset, Value::Utf8)], vec![(Attr::Charset, Value::Utf8)],
); );
let cache_header = Header(CacheControl(vec![ let cache_headers = (
CacheDirective::Public, Header(CacheControl(vec![
CacheDirective::MaxAge(TTL), CacheDirective::Public,
])); CacheDirective::MaxAge(TTL),
])),
Header(Expires(HttpDate(
time::now() + Duration::seconds(TTL.into()),
))),
);
let vary_header = Header(Vary::Items(vec![ let vary_header = Header(Vary::Items(vec![
UniCase::from_str("accept-encoding").unwrap(), UniCase::from_str("accept-encoding").unwrap(),
UniCase::from_str("accept").unwrap(), UniCase::from_str("accept").unwrap(),
@ -202,7 +213,7 @@ impl WebService {
let response = Response::with(( let response = Response::with((
status::BadRequest, status::BadRequest,
mime_text, mime_text,
cache_header, cache_headers,
"Missing IP address", "Missing IP address",
)); ));
return Ok(response); return Ok(response);
@ -214,7 +225,7 @@ impl WebService {
return Ok(Response::with(( return Ok(Response::with((
status::BadRequest, status::BadRequest,
mime_text, mime_text,
cache_header, cache_headers,
"Invalid IP address", "Invalid IP address",
))); )));
} }
@ -232,7 +243,7 @@ impl WebService {
"announced".to_string(), "announced".to_string(),
serde_json::value::Value::Bool(false), serde_json::value::Value::Bool(false),
); );
return Self::output(&Self::accept_type(req), &map, cache_header, vary_header); return Self::output(&Self::accept_type(req), &map, cache_headers, vary_header);
} }
Some(found) => found, Some(found) => found,
}; };
@ -260,7 +271,7 @@ impl WebService {
"as_description".to_string(), "as_description".to_string(),
serde_json::value::Value::String(found.description.clone()), serde_json::value::Value::String(found.description.clone()),
); );
Self::output(&Self::accept_type(req), &map, cache_header, vary_header) Self::output(&Self::accept_type(req), &map, cache_headers, vary_header)
} }
pub fn start(asns_arc: Arc<RwLock<Arc<ASNs>>>, listen_addr: &str) { pub fn start(asns_arc: Arc<RwLock<Arc<ASNs>>>, listen_addr: &str) {