13 unstable releases (3 breaking)

0.4.0 Jul 20, 2024
0.3.0 Apr 18, 2024
0.2.2 Mar 4, 2024
0.2.1 Dec 5, 2023
0.2.0 Nov 10, 2023

#714 in Cryptography

Download history 1/week @ 2024-08-27 5/week @ 2024-09-10 2/week @ 2024-09-17 46/week @ 2024-09-24 11/week @ 2024-10-01

678 downloads per month
Used in 3 crates (2 directly)

MIT license

85KB
2.5K SLoC

main License: MIT docs.rs

transip

This library crate can be used for calling functions on the Transip Api endpoint. Only part of the api is implemented. The main reason for writing this library is the ability to CRUD dns records for a particular domain. This functionality can be used to respond to DNS01 challenges from the Let's Encrypt servers. This type of challenge is needed to get wildcard certificates.

Example

use transip::{configuration_from_environment, Client, api::general::GeneralApi};

let mut client = configuration_from_environment()
    .and_then(Client::try_from)
    .expect("No cliënt");

let pong = client.api_test().expect("api test failed");
assert_eq!(pong.as_str(), "pong");

Environment variables

The following environment variables should be set!.

TRANSIP_API_USERNAME

This is the username used in authentication

Example

export TRANSIP_API_USERNAME=paulusminus

TRANSIP_API_PRIVATE_KEY

This is the name of the file that holds the pem encoded private key used in authentication

Example

export TRANSIP_API_PRIVATE_KEY=/etc/transip/private.pem

TRANSIP_API_READONLY

Can be 'true' or 'false'. If you wan't to prevent accidental modifications set this to 'true'.

Example

export TRANSIP_API_READONLY=false

TRANSIP_API_IPV6ONLY

Can be 'true' or 'false'. Use true if on a ipv6 only (virtual) machine.

Example

export TRANSIP_API_IPV6ONLY=false

TRANSIP_API_WHITELISTED_ONLY

Can be 'true' or 'false'. If you wan't to access the api on a whitelisted ipaddress set this to 'true'.

TRANSIP_API_TOKEN_EXPIRATION

Authentication means receiving a token. The interval in which the received will expired can be controlled.

Example 1

export TRANSIP_API_TOKEN_EXPIRATION=5 minutes

Example 2

export TRANSIP_API_TOKEN_EXPIRATION=55 seconds

Example 3

export TRANSIP_API_TOKEN_EXPIRATION=1 hour

TRANSIP_API_LOG_DIR

Directory where the rotating log files are written.

Example

export TRANSIP_API_LOG_DIR=/var/log/transip

TRANSIP_API_TOKEN_PATH

Name of the file where the authentication token received from the endpoint will be written to.

Example

export TRANSIP_API_TOKEN_PATH=/root/.token.txt

Dependencies

~10–18MB
~341K SLoC