You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by GitBox <gi...@apache.org> on 2019/12/27 11:54:32 UTC

[GitHub] [httpcomponents-client] michael-o opened a new pull request #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

michael-o opened a new pull request #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190
 
 
   …e rest of the code uses the lowercase version
   
   The auth scheme name is now consistently processed either in lowercse or
   with String#equalsIgnoreCase().
   
   @garydgregory @ok2c Please share your opinion. Another approach would also be to leave as-is because `AuthScheme#getName()` is retained as-is and lowercased where ever appropriate. That would be even better for consistency. Shall I rework the issue and PR then?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] garydgregory commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
garydgregory commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569449884
 
 
   Should we not keep the auth scheme strings to the two styles we already have? IOW:
   - The upper case names as the enum names in org.apache.hc.client5.http.auth.AuthSchemes: BASIC, DIGEST, and so on.
   - The mixed case names as the 'ident' field of org.apache.hc.client5.http.auth.AuthSchemes: "Basic", "Digest", and so on.
   
   Question... I see we have these 2 ctors:
   - org.apache.hc.client5.http.auth.AuthScope.AuthScope(HttpHost, String, String)
   - org.apache.hc.client5.http.auth.AuthScope.AuthScope(String, String, int, String, String)
   These both take a schemeName. 
   Why not avoid confusion and type this as an AuthScheme? Or both?
   This goes back to the email thread about how extenstible AuthScheme(s) are suppose to be. 
   This needs clarification before we continue IMO.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569504324
 
 
   > Always consider that enums are designed to be exhaustive
   
   @michael-o Out of curiosity, who decreed that?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569503321
 
 
   @garydgregory All of your analysis leads me to the conclusion that the enum *and* strings do not make sense together. Always consider that enums are designed to be exhaustive. Our support is not exhaustive... I will work on a proposal.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569659465
 
 
   This will be superseded with an upcoming PR.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o edited a comment on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o edited a comment on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569505000
 
 
   > 
   > 
   > > Always consider that enums are designed to be exhaustive
   > 
   > @michael-o Out of curiosity, who decreed that?
   
   @ok2c, in my opinion this is a convention. Since a client cannot extend or create custom enum instances, the list remains unmodifiable, thus always complete. Therefore, you can use `==` for comparsion because one enum value exists in the class loader.
   
   I cannot say
   
   ```
   public enum EnterpriseAuthSchemes extends AuthSchemes {
   
     COOL("Cool")
   
   }
   ```
   
   Can you share a counterexample for non-exhaustive enums?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569431722
 
 
   @michael-o I still have no idea what you see as inconsistency here. Auth scheme names are case-insensitive much so as domain names. Please go ahead and change whatever feel like changing as long as it gets done fast. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569505000
 
 
   > 
   > 
   > > Always consider that enums are designed to be exhaustive
   > 
   > @michael-o Out of curiosity, who decreed that?
   
   @ok2c, in my opinion this is a convention. Since a client cannot extend or create custom enum instances, the list remains unmodifiable, thus always complete. Therefore, you can use `==` for comparsion because one enum value exists in the class loader.
   
   I cannot say
   
   ```
   public enum EnterpriseAuthSchemes extends AuthSchemes {
   
     COOL("Cool")
   
   }
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o closed pull request #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o closed pull request #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190
 
 
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] garydgregory commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
garydgregory commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569511163
 
 
   > > @michael-o But enums can be extended in future releases without breaking binary compatibility. They can never be assumed to be complete and final.
   > 
   > Given with the current enum semantics. They are final implicitly. I cannot see in the future whether this will change. I remember my programming lecture when Sun introduced enums back then and the professor said they did not make it extendable for a good reason.
   > 
   > Making assumptions about likely possible features will make any design decision really hard.
   > 
   > > This whole enum renaming stuff is nothing more than assumptions and personal fancy.
   > 
   > Partially right, but can't consistency be objective in this case?
   
   A big +1 for consistency. 
   
   Having mentored many junior developers, I can attest that inconsistency is not good for maintenance and even guiding new code; you end up having to explain _why_ the code is inconsistent, is it by design (why?) or by lack of code review or care (lame).
   
   > 
   > > We are getting a bit side tracked here but an enum is finite by definition. Arguing they can be extended by a future release is not a valid point IMO. I can't write code today (a switch for example) for an enum value that will only exist in the future. This is obviously completely different than using a String where you can write anything you want.
   > 
   > +1, totally agree. Future extensions will break code. This is actually something Sun never wanted. Therefore generics have been implemented in a reified way.
   
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] garydgregory commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
garydgregory commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569506038
 
 
   We are getting a bit side tracked here but an enum is finite by definition. Arguing they can be extended by a future release is not a valid point IMO. I can't write code today (a switch for example) for an enum value that will only exist in the future. This is obviously completely different than using a String where you can write anything you want.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569411027
 
 
   > 
   > 
   > > Another approach would also be to leave as-is because AuthScheme#getName() is retained as-is and lowercased where ever appropriate. That would be even better for consistency.
   > 
   > @michael-o I am not sure I understand the need to make any changes of what so ever, so leaving things as is would be my preference.
   
   Let me rephrase the confusing inconsistency I see: `AuthScheme#getName()` returns the scheme name as-is while `AuthScope#getScheme()` returns it in uppercase for no apparent reason.
   It that better to understand?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569406562
 
 
   > Another approach would also be to leave as-is because AuthScheme#getName() is retained as-is and lowercased where ever appropriate. That would be even better for consistency.
   
   @michael-o I am not sure I understand the need to make any changes of what so ever, so leaving things as is would be my preference.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569519586
 
 
   > Partially right, but can't consistency be objective in this case?
   
   @michael-o I am not sure what consistency you are referring to, given that singular case convention for enums as well as their finality is just your personal opinion. 
   
   Having said that, as long as you rename whatever stuff into some other stuff you fancy fast, I will not stand in your way. I just want this renaming party to be over. It has been going on for months already.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
ok2c commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569505662
 
 
   @michael-o But enums can be extended in future releases without breaking binary compatibility. They can never be assumed to be complete and final. 
   
   This whole enum renaming stuff is nothing more than assumptions and personal fancy. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569543032
 
 
   > 
   > 
   > > Partially right, but can't consistency be objective in this case?
   > 
   > @michael-o I am not sure what consistency you are referring to, given that singular case convention for enums as well as their finality is just your personal opinion.
   > 
   > Having said that, as long as you rename whatever stuff into some other stuff you fancy fast, I will not stand in your way. I just want this renaming party to be over. It has been going on for months already.
   
   Acknowledged.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o edited a comment on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o edited a comment on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569659465
 
 
   This will be superseded with an upcoming PR today.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org


[GitHub] [httpcomponents-client] michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…

Posted by GitBox <gi...@apache.org>.
michael-o commented on issue #190: [HTTPCLIENT-2042] AuthScope uses uppercase for scheme name whereas th…
URL: https://github.com/apache/httpcomponents-client/pull/190#issuecomment-569506878
 
 
   > 
   > 
   > @michael-o But enums can be extended in future releases without breaking binary compatibility. They can never be assumed to be complete and final.
   
   Given with the current enum semantics. They are final implicitly. I cannot see in the future whether this will change. I remember my programming lecture when Sun introduced enums back then and the professor said they did not make it extendable for a good reason.
   
   Making assumptions about likely possible features will make any design decision really hard.
   
   > This whole enum renaming stuff is nothing more than assumptions and personal fancy.
   
   Partially right, but can't consistency be objective in this case?
   
   > We are getting a bit side tracked here but an enum is finite by definition. Arguing they can be extended by a future release is not a valid point IMO. I can't write code today (a switch for example) for an enum value that will only exist in the future. This is obviously completely different than using a String where you can write anything you want.
   
   +1, totally agree. Future extensions will break code. This is actually something Sun never wanted. Therefore generics have been implemented in a reified way.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org