From 933f49ae3bf3769992a7d3ff179e45bb88e4728a Mon Sep 17 00:00:00 2001 From: James Kessler Date: Wed, 17 Aug 2022 10:01:06 -0600 Subject: [PATCH] Add apikey auth --- src/v1_0_0/mod.rs | 9 ++++++++- src/v2_0_0/mod.rs | 7 +++++++ src/v2_1_0/mod.rs | 7 +++++++ 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/src/v1_0_0/mod.rs b/src/v1_0_0/mod.rs index 8db43c5..2e38a30 100644 --- a/src/v1_0_0/mod.rs +++ b/src/v1_0_0/mod.rs @@ -69,7 +69,7 @@ pub struct Spec { /// Represents authentication helpers provided by Postman #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)] pub struct Auth { - /// The auth type. Either `noauth`, `awsv4`, `basic`, `bearer`, `digest`, `hawk`, `ntlm`, `oauth1`, or `oauth2`. + /// The auth type. Either `noauth`, `apikey`, `awsv4`, `basic`, `bearer`, `digest`, `hawk`, `ntlm`, `oauth1`, or `oauth2`. #[serde(rename = "type")] pub auth_type: AuthType, @@ -77,6 +77,10 @@ pub struct Auth { #[serde(rename = "noauth")] pub noauth: Option, + /// The attributes for [API key Auth](https://en.wikipedia.org/wiki/API_key). + #[serde(rename = "apikey")] + pub api_key: Option>, + /// The attributes for [AWS Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). #[serde(rename = "awsv4")] pub awsv4: Option>, @@ -888,6 +892,9 @@ pub enum Time { #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] pub enum AuthType { + #[serde(rename = "apikey")] + Apikey, + #[serde(rename = "awsv4")] Awsv4, diff --git a/src/v2_0_0/mod.rs b/src/v2_0_0/mod.rs index b088744..643198e 100644 --- a/src/v2_0_0/mod.rs +++ b/src/v2_0_0/mod.rs @@ -26,6 +26,10 @@ pub struct Spec { /// Represents authentication helpers provided by Postman #[derive(Clone, Debug, Deserialize, Serialize, PartialEq, Default)] pub struct Auth { + /// The attributes for [API key Auth](https://en.wikipedia.org/wiki/API_key). + #[serde(rename = "apikey")] + pub api_key: Option>>, + /// The attributes for [AWS /// Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). e.g. /// accessKey, secretKey, region, service. @@ -751,6 +755,9 @@ pub enum ResponseTime { #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] pub enum AuthType { + #[serde(rename = "apikey")] + Apikey, + #[serde(rename = "awsv4")] Awsv4, diff --git a/src/v2_1_0/mod.rs b/src/v2_1_0/mod.rs index 616b530..41bb96f 100644 --- a/src/v2_1_0/mod.rs +++ b/src/v2_1_0/mod.rs @@ -24,6 +24,10 @@ pub struct Spec { /// Represents authentication helpers provided by Postman #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] pub struct Auth { + /// The attributes for [API key Auth](https://en.wikipedia.org/wiki/API_key). + #[serde(rename = "apikey")] + pub api_key: Option>, + /// The attributes for [AWS /// Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). #[serde(rename = "awsv4")] @@ -765,6 +769,9 @@ pub enum ResponseTime { #[derive(Clone, Debug, Deserialize, Serialize, PartialEq)] pub enum AuthType { + #[serde(rename = "apikey")] + Apikey, + #[serde(rename = "awsv4")] Awsv4,