Skip to content

Use updated metadata auth call credentials core API in Python (and migrate to Cython)#4228

Merged
nathanielmanistaatgoogle merged 6 commits intogrpc:release-0_12from
soltanmm:cy-rel
Dec 8, 2015
Merged

Use updated metadata auth call credentials core API in Python (and migrate to Cython)#4228
nathanielmanistaatgoogle merged 6 commits intogrpc:release-0_12from
soltanmm:cy-rel

Conversation

@soltanmm
Copy link
Copy Markdown
Contributor

@soltanmm soltanmm commented Dec 1, 2015

Arguably some Python casing conventions aren't being followed in the records.pyx, but they were there before (... and I disagree with myself now...) and we can go back and change them before GA anyway.

@jboeuf see files src/python/grpcio/grpc/beta/implementations.py and src/python/grpcio/grpc/beta/interfaces.py
Fixes #3908
cc @nathanielmanistaatgoogle
cc #282

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks. I take it that the API change will be additive (non breaking) when we add the auth_context.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe it'll be additive.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

nit: call credentials -> CallCredentials

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The return type itself is in the return type doc-comment below, and I'd feel a bit weird then calling the auth metadata plugin an 'auth metadata plugin' as opposed to giving it some proper type.

Actually, that's a question: should the metadata_callback argument actually be some metadata_auth_plugin argument with an abstract class interface somewhere? I'm leaning towards no, for ease of use, but just bringing it up as a possibility.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The return type itself is in the return type doc-comment below, and I'd feel a bit weird then calling the auth metadata plugin an 'auth metadata plugin' as opposed to giving it some proper type.

I'm OK with that but then, I think it would make sense to change the doc for the ssl_credentials which uses ChannelCredentials as opposed to channel credentials (see my new comment on this).

Actually, that's a question: should the metadata_callback argument actually be some metadata_auth_plugin argument with an abstract class interface somewhere? I'm leaning towards no, for ease of use, but just bringing it up as a possibility.

This more of a python question I believe. What would you, user of the API, think would be the most appropriate? Maybe @nathanielmanistaatgoogle has some good insight on this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, it should - I'm really stumbling over the complicated type description here.

@jboeuf
Copy link
Copy Markdown
Contributor

jboeuf commented Dec 3, 2015

Changes LGTM. Thanks much! After you have addressed the latest cosmetic comments, can you please do a PR to update the doc as well?

Here's the C# one for a model:
https://github.com/grpc/grpc.github.io/pull/126/files

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

So maybe ChannelCredentials -> channel credentials here to be consistent with call credentials below?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With the changed interface choices, went in the other direction with the below.

@nathanielmanistaatgoogle
Copy link
Copy Markdown
Contributor

Probably-irrelevant fact: GitHub is currently showing the commits in this pull request to me as:
soltanmm@2c6cf12
soltanmm@3ca5045
soltanmm@5e080db
soltanmm@3051737
soltanmm@7430062
. Which I don't think is ordered by author time or commit time, and it's definitely not by ancestry. I had to draw out the line of development on paper to discover that this is actually just an ordinary line of commits with no merging. :-P

@nathanielmanistaatgoogle
Copy link
Copy Markdown
Contributor

Looks mostly fantastic; one major comment left on soltanmm@2c6cf12 and a few minor comments sprinkled around.

@soltanmm soltanmm force-pushed the cy-rel branch 2 times, most recently from d42169c to cffade9 Compare December 8, 2015 00:43
@soltanmm
Copy link
Copy Markdown
Contributor Author

soltanmm commented Dec 8, 2015

Rebased.

@soltanmm
Copy link
Copy Markdown
Contributor Author

soltanmm commented Dec 8, 2015

Interop tests will fail on this until #4323 goes in.

@soltanmm
Copy link
Copy Markdown
Contributor Author

soltanmm commented Dec 8, 2015

(interop test failures are unrelated, unit tests are green)

@jboeuf
Copy link
Copy Markdown
Contributor

jboeuf commented Dec 8, 2015

Thanks much! I'm good with this. @nathanielmanistaatgoogle do you want to merge?

@nathanielmanistaatgoogle
Copy link
Copy Markdown
Contributor

Probably-irrelevant-but-again-fun fact: GitHub is again showing these commits to me in a crazy order and I again had to draw them out on paper to persuade myself that they represent a linear sequence of development. GitHub is showing them to me from top to bottom as

soltanmm@f21dc7e
soltanmm@13ee182
soltanmm@0f1bf32
soltanmm@25ef5c8
soltanmm@ae873a6
soltanmm@aed42a8

. If we semantically order the commits as 1,2,3,4,5,6 (and "parents much precede children" semantic ordering is clear regardless of the chronological author timestamp and commit timestamp of any commit), then the order in which GitHub is showing them in this code review is 3,1,6,5,4,2.

Crazypants, and it makes code review that much harder. :-(

@soltanmm
Copy link
Copy Markdown
Contributor Author

soltanmm commented Dec 8, 2015

I'm seeing that, too... so weird.

@nathanielmanistaatgoogle
Copy link
Copy Markdown
Contributor

Change looks good to me in all respects but test results. @soltanmm are the test results I'm currently seeing all "explained" and this is safe to merge? Should anything be rerun?

@soltanmm
Copy link
Copy Markdown
Contributor Author

soltanmm commented Dec 8, 2015

All test failures are in Ruby and cannot AFAIK mask possible Python failures.

nathanielmanistaatgoogle added a commit that referenced this pull request Dec 8, 2015
Use updated metadata auth call credentials core API in
Python (and migrate to Cython).
@nathanielmanistaatgoogle nathanielmanistaatgoogle merged commit 9608705 into grpc:release-0_12 Dec 8, 2015
@soltanmm soltanmm deleted the cy-rel branch January 5, 2016 21:16
@lock lock bot locked as resolved and limited conversation to collaborators Jan 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants