-
Notifications
You must be signed in to change notification settings - Fork 1
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
eID-Service Integration #57
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As a general point, please increase code documentation throughout your PR.
}); | ||
}); | ||
|
||
it("is working fine", function(done) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description here should be a little more descriptive. I advise to split this test case into several expectation handlers to make it more readable:
frisby.get(....getTcTokenUrl....)
.expect('status', 302)
.expect('tcToken retrievable')
where the new tcToken retrievable
expectation handlers implements most of the actual testing.
With #55 in mind, this should be compatible with chakram by extending chai.
@@ -0,0 +1,39 @@ | |||
describe("eID-Service: The general flow", function() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This suit just contains one positive test case. Please also add some negative checks to increase the test coverage to the cases where we need to reply faulty requests in the eid service / eid server.
It may be worthwhile to add a README to the eid server Django app to summarize the interface. Alternatively, this could be entirely put in code docs. |
You're right. Doc is now required as the complexity is high. I put it in code. Update: I added documentation. TODO:
|
6a6b30c
to
03cceaa
Compare
Currently the openid provider expects a POST with username, client_id, redirect_uri, response_type, scope and state. The username is used to present the restricted userID, so i think we can than use the provided getUserId for that. @larissazech, @m273d15 Please correct me, if i am wrong. Edit: See #62 for a description more precisely. |
969518c
to
2954bfb
Compare
Chakram seems to be broken, too? |
2954bfb
to
7d98b4d
Compare
looks good to me, why do you think it is broken? |
@nils-wisiol The link is not working. Have a look at build #266 in travis. Rebasing done. |
7d98b4d
to
d40a8c2
Compare
In the travis build, tests fail as regex do not match. The
does indeed not match the given expression
Try escaping
|
Hi @nils-wisiol your described issue was problem of the test Nevertheless, this branch can be merged. |
I'd blame that problem on the double-definition (here and here) of the Chakram (using chai) runs all tests parallel, so you get a race condition and your expectation was overwritten. I didn't reproduce this locally, but unless there is indication that this theory could be wrong, I'd rather spare the work. |
@@ -1,5 +1,5 @@ | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
api/eid_server/serviceInterface.py
Outdated
@@ -0,0 +1,24 @@ | |||
from eid_server.models import ServiceRequest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to PEP8, python modules (i.e. source files) should have all lower-case names
This shouldn't be a problem as every suite has its own Do you have any further suggestions or can we merge? |
The double definition is put onto a singleton object, that's why the old one is overwritten. (That's how |
1f00fe5
to
bd4f61b
Compare
@nils-wisiol Files renamed, database migrated and tests improved. Do you check line feeds, formatting and style conventions manually or do you have some cool tool? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This lgtm! Nice work.
I found one more typo, see code annotations. One more general thing, using 'correct' as test description is a tautology: your tests always check if the system behaves correctly. So, if you want to further improve this PR, rename the tests to something avoiding the word 'correct'. How about adding a method rather than a property that can be used like expect(...).to.redirect_to(CONST_REGEX)
? Anyways, this is good enough for merging (but please fix the typo real quick -- the approval will stay).
api/eid_service/views.py
Outdated
|
||
def error(request): | ||
return HttpResponse("An error occurred during the authentication.") | ||
""" | ||
The use agent is redirected to this view if the authentication session between eID-Client |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"user agent"
I do not use a tool to check style conventions on reviews (unless I have a suspicion), but I recommend pycharm's integrated style checker. For line endings, I find GNU/Linux' file command helpful. I used it for checking line endings in a bunch of files at once. |
bd4f61b
to
95e9117
Compare
@nils-wisiol Thank you very much for your answer. I fixed the typo. I will use a constant redirect test function for testing next time! |
Alrighty. Looking forward to see this in master.
…On August 29, 2017 10:49:52 PM GMT+02:00, BenjaminKeller ***@***.***> wrote:
@nils-wisiol Thank you very much for your answer. I fixed the typo. I
will use a constant redirect test function for testing next time!
--
You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub:
#57 (comment)
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.
|
This pull request implements the required functionality of the interfaces of the eID-Service.
It contains the interface to the eID-Server so the SAML-procedure has only to modify the value of
restrictedId
in theServiceRequest
table. @Armagetron Please give some feedback about that.Moreover it provides the view
getUserId
for the openId Provider. TherefreshAddress
provides a json containing the access token:getUserId
provides the restricted id as base64:@nielsgroth @m273d15 @larissazech Please give some feedback.
See also #44 and #46.