Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add apikey auth #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
9 changes: 8 additions & 1 deletion src/v1_0_0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,18 @@ 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,

/// No authentication
#[serde(rename = "noauth")]
pub noauth: Option<serde_json::Value>,

/// The attributes for [API key Auth](https://en.wikipedia.org/wiki/API_key).
#[serde(rename = "apikey")]
pub api_key: Option<Vec<AuthAttribute>>,

/// The attributes for [AWS Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).
#[serde(rename = "awsv4")]
pub awsv4: Option<Vec<AuthAttribute>>,
Expand Down Expand Up @@ -888,6 +892,9 @@ pub enum Time {

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub enum AuthType {
#[serde(rename = "apikey")]
Apikey,

#[serde(rename = "awsv4")]
Awsv4,

Expand Down
7 changes: 7 additions & 0 deletions src/v2_0_0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<HashMap<String, Option<serde_json::Value>>>,

/// The attributes for [AWS
/// Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html). e.g.
/// accessKey, secretKey, region, service.
Expand Down Expand Up @@ -751,6 +755,9 @@ pub enum ResponseTime {

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub enum AuthType {
#[serde(rename = "apikey")]
Apikey,

#[serde(rename = "awsv4")]
Awsv4,

Expand Down
7 changes: 7 additions & 0 deletions src/v2_1_0/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Vec<AuthAttribute>>,

/// The attributes for [AWS
/// Auth](http://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html).
#[serde(rename = "awsv4")]
Expand Down Expand Up @@ -765,6 +769,9 @@ pub enum ResponseTime {

#[derive(Clone, Debug, Deserialize, Serialize, PartialEq)]
pub enum AuthType {
#[serde(rename = "apikey")]
Apikey,

#[serde(rename = "awsv4")]
Awsv4,

Expand Down