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 endpoint for answering access requests directly #42

Closed
aeneasr opened this issue Dec 13, 2017 · 11 comments
Closed

Add endpoint for answering access requests directly #42

aeneasr opened this issue Dec 13, 2017 · 11 comments

Comments

@aeneasr
Copy link
Member

aeneasr commented Dec 13, 2017

No description provided.

@euank
Copy link
Contributor

euank commented Feb 28, 2018

Mind fleshing out some detail here? I'm not quite sure what you mean from just the title.

@aeneasr
Copy link
Member Author

aeneasr commented Feb 28, 2018

The idea here is that we have an endpoint which is capable of answering requests based on the rules defined in oathkeeper, but without the proxy capability. So a bit like the warden endpoint + access rule :)

@calind
Copy link

calind commented Mar 19, 2018

@arekkas, this means it can be used with nginx auth_request module?

@aeneasr
Copy link
Member Author

aeneasr commented Mar 19, 2018

Yes, looks like it would!

@calind
Copy link

calind commented Mar 19, 2018

Cool. That would be pretty awesome.

@aeneasr
Copy link
Member Author

aeneasr commented Jul 11, 2018

Good discussion on this in the ambassador slack channel. I think their design approach is really good on this, see: https://www.getambassador.io/reference/services/auth-service

edit// once done ping rdl/flynn and they might publish it as a blog post

@robertrbruno
Copy link

Was researching nice out of the box ways to integrate oauth with ambassador. Saw the slack channel discussion and sounds like this would go a long way of making it happen. Hoping this happens.

@aeneasr
Copy link
Member Author

aeneasr commented Jul 11, 2018

It shouldn't be very hard to add this functionality as it's basically all here already, especially since we're answering those requests based on the HTTP protocol itself, which is what we're already doing for the proxy. What would change is obviously the response but that is not hard to deal with. There are still other issues that need to be addressed by our team first, but it's on the list!

@robertrbruno
Copy link

Awesome. Any order of magnitude time estimate on when this may happen. As in weeks, months, years? Thanks!

@aeneasr
Copy link
Member Author

aeneasr commented Jul 11, 2018

Can't guarantee anything, definitely not years nor many months, maybe 4-8 weeks.

@robertrbruno
Copy link

Thanks. Just was looking for a rough estimate to decide if I can wait a bit for this. I'll keep an eye out for sure.

aeneasr pushed a commit that referenced this issue Jul 22, 2018
This patch adds endpoint `/judge` to `oathkeeper serve api`. The `/judge` endpoint mimics the behavior of `oathkeeper serve proxy` but instead of forwarding the request to the upstream server, the endpoint answers directly with a HTTP response.

The HTTP response returns status code 200 if the request should be allowed and any other status code (e.g. 401, 403) if not.

Assuming you are making the following request:

```
PUT /judge/my-service/whatever HTTP/1.1
Host: oathkeeper-api:4456
User-Agent: curl/7.54.0
Authorization: bearer some-token
Accept: */*
Content-Type: application/json
Content-Length: 0
```

And you have a rule which allows token `some-bearer` to access `PUT /my-service/whatever` and you have a credentials issuer which does not modify the Authorization header, the response will be:

```
HTTP/1.1 200 OK
Authorization: bearer-sometoken
Content-Length: 0
Connection: Closed
```

If the rule denies the request, the response will be, for example:

```
HTTP/1.1 401 OK
Content-Length: 0
Connection: Closed
```

Close #42

Signed-off-by: arekkas <[email protected]>
aeneasr pushed a commit that referenced this issue Jul 22, 2018
This patch adds endpoint `/judge` to `oathkeeper serve api`. The `/judge` endpoint mimics the behavior of `oathkeeper serve proxy` but instead of forwarding the request to the upstream server, the endpoint answers directly with a HTTP response.

The HTTP response returns status code 200 if the request should be allowed and any other status code (e.g. 401, 403) if not.

Assuming you are making the following request:

```
PUT /judge/my-service/whatever HTTP/1.1
Host: oathkeeper-api:4456
User-Agent: curl/7.54.0
Authorization: bearer some-token
Accept: */*
Content-Type: application/json
Content-Length: 0
```

And you have a rule which allows token `some-bearer` to access `PUT /my-service/whatever` and you have a credentials issuer which does not modify the Authorization header, the response will be:

```
HTTP/1.1 200 OK
Authorization: bearer-sometoken
Content-Length: 0
Connection: Closed
```

If the rule denies the request, the response will be, for example:

```
HTTP/1.1 401 OK
Content-Length: 0
Connection: Closed
```

Close #42

Signed-off-by: arekkas <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants