Skip to main content

reqsign_aws_core/
lib.rs

1// Licensed to the Apache Software Foundation (ASF) under one
2// or more contributor license agreements.  See the NOTICE file
3// distributed with this work for additional information
4// regarding copyright ownership.  The ASF licenses this file
5// to you under the Apache License, Version 2.0 (the
6// "License"); you may not use this file except in compliance
7// with the License.  You may obtain a copy of the License at
8//
9//   http://www.apache.org/licenses/LICENSE-2.0
10//
11// Unless required by applicable law or agreed to in writing,
12// software distributed under the License is distributed on an
13// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14// KIND, either express or implied.  See the License for the
15// specific language governing permissions and limitations
16// under the License.
17
18#![doc = include_str!("../README.md")]
19
20pub mod constants;
21
22#[doc(hidden)]
23pub mod assume_role;
24pub use assume_role::AssumeRoleGrant;
25
26mod credential;
27pub use credential::Credential;
28
29mod provide_credential;
30pub use provide_credential::*;
31
32#[doc(hidden)]
33pub mod signing;
34
35pub const EMPTY_STRING_SHA256: &str =
36    "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
37
38#[cfg(test)]
39mod tests {
40    use reqsign_core::hash::hex_sha256;
41
42    use super::EMPTY_STRING_SHA256;
43
44    #[test]
45    fn empty_string_sha256_matches_computed_digest() {
46        assert_eq!(EMPTY_STRING_SHA256, hex_sha256(b""));
47        assert_eq!(
48            EMPTY_STRING_SHA256,
49            "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
50        );
51    }
52}