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

Basic Authentication Scheme #5

Merged
merged 1 commit into from
Nov 26, 2015
Merged

Basic Authentication Scheme #5

merged 1 commit into from
Nov 26, 2015

Conversation

kylef
Copy link
Member

@kylef kylef commented Sep 29, 2015

This pull request extends on the authentication framework (proposed in #4) to provide a base authentication scheme called "Basic".

Dependencies:

@kylef kylef added the draft label Sep 29, 2015
would be based64 encoded and placed in the authorization header as follows:

```
Authorization: Basic a3lsZTpiMjk1MmQwM2JkYTA5Y2I1ZjYzYjAxNjJmYmJlZTc3Yw==
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like this is very similar to the OAuth problem mentioned in the other PR. Basically you have a field that is made up of a constant and some computed value.

@danielgtaylor
Copy link
Contributor

👍 Looks good.

As an anonymous scheme:

```apib
+ Basic
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this ought be + Authentication (Basic)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+ Authenticated (Basic) to be exact.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This bas been addressed.

@zdne
Copy link
Contributor

zdne commented Oct 21, 2015

Looks good but the #5 (comment)

@zdne
Copy link
Contributor

zdne commented Nov 3, 2015

Ping @kylef this is good to go once https://github.com/apiaryio/api-blueprint-rfcs/pull/5/files#r42629521 is addressed.


As such, a basic authentication scheme may configure two properties,
`username` and `password`. These properties indicate a sample username and
password that may be used.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly are we configuring here? We say properties. But we are actually configuring sample username and sample password. I don't see any mention about the values being an example.

Also, I think we should have a default example username and example password for Basic.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As per the MSON Specification, 2.3.1 Property Member Types, the properties within an MSON object are called "Properties". The wording here reflects that.

These are properties within the authentication scheme's object.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As for the sample/example, I'm not sure I follow. What would the difference between sample and example be?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mention the default values for the properties username and password, then this looks good.

@pksunkara
Copy link
Contributor

My review is done. I have a #5 (comment) which needs to be clarified for this to move forward.

@pksunkara
Copy link
Contributor

Reviewed the latest changes.

@kylef
Copy link
Member Author

kylef commented Nov 4, 2015

@pksunkara I've updated this pull request now.

```

There are no default values for the sample `username` and `password`. When
these are both unset, there is no sample credentials.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kylef Are we sure about this? Some users might want to directly use Basic simply like this:

+ Authenticated (Basic)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes they can, just because there are no defaults, doesn't mean you can't indicate that a resource/group/action/request example etc supports the basic scheme. It just represents there are not sample credentials available.

You don't need to define a sample username or password to use this scheme.

Does this make sense? Is there something I can add to make this a little clearer?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You don't need to define a sample username or password to use this scheme.

I understand and I agree. But we also need to think about the tools which use API Blueprint. Dredd, Documentation and others like them. Let's take the example of Dredd. User uses the Basic directly for an action. But what values will dredd use now when testing the server? If we leave this upto the tools, each one of them will have their own default values and user will start getting overwhelmed. Having a default sample username and password will avoid all this.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think if there is no sample values, a user should have to supply the value to use at run-time. For example:

$ dredd --user kyle:password

I disagree that we should require services to provide a sample account which is described in the blueprint (and even dictating the default username/password).

/cc @netmilk -- would love to hear your thoughts around this matter.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dredd supports basic auth already by supplying the user and password from command line as described above by @kylef and I don't see a reason why we shouldn't keep it that way. I think the mandatory sample account is not necessary. Blueprint doesn't require defaults on anything so why it should all of a sudden require it it doesn't make sense. Sure I would push users to provide values as a convenient way how to do things but not force them to.

@zdne
Copy link
Contributor

zdne commented Nov 26, 2015

👍

zdne added a commit that referenced this pull request Nov 26, 2015
@zdne zdne merged commit 5f725af into master Nov 26, 2015
@zdne zdne deleted the kylef/basic-authentication branch November 26, 2015 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants