Hi Jody,
thinking out loud, the OWS spec (that WMTS is based on) states that keys
are case insensitive.
So the Mapbox server is broken, but I see no need to uppercase the keys in
the GeoTools code,
just let them be whatever they are?

Cheers
Andrea

On Fri, Jan 17, 2020 at 5:45 AM Jody Garnett <jody.garn...@gmail.com> wrote:

> I am not aware of anyone working on this issue...
>
> Having a look myself (the geotools library is used for this interaction):
>
> AbstractRequest has the following
> <https://github.com/geotools/geotools/blob/master/modules/library/main/src/main/java/org/geotools/data/ows/AbstractRequest.java#L155>
> :
>
>             String value = (String) entry.getValue();
>             /*
>              * Some servers do not follow the rule that parameter names
>              * must be case insensitive. We will let each specification
>              * implementation deal with it in their own way.
>              */
>             String param = processKey((String) entry.getKey());
>
> So some allowance has been made to be case insensitive or not...
>
> WMTSSpecification GetCapsRequest has this implemented
> <https://github.com/geotools/geotools/blob/master/modules/extension/wmts/src/main/java/org/geotools/ows/wmts/WMTSSpecification.java#L132>
> as:
>
>         @Override
>         protected String processKey(String key) {
>             return WMTSSpecification.processKey(key);
>         }
>
> WMTSSepcification forces everything uppercase
> <https://github.com/geotools/geotools/blob/master/modules/extension/wmts/src/main/java/org/geotools/ows/wmts/WMTSSpecification.java#L147>
> :
>
>     public static String processKey(String key) {
>         return key.trim().toUpperCase();
>     }
>
> So a minimal change would be to WMTS GetCapsRequest above:
>
> final Set<String> SPECIFICATION_PARAMETERS.containsKey;
> {
>   Set<String> official = new HashSet<String>();
>   official.add("SERVICE");
>   official.add("VERSION");
>   official.add("REQUEST");
>   ...
>   SPECIFICATION_PARAMETERS = Collections. unmodifiableSet(official);
> }
> protected String processKey(String key) {
>        String key = key.trim();
>        if( SPECIFICATION_PARAMETERS.containsKey(key.toUpperCase()){
>            return WMTSSpecification.processKey(key);
>        }
>        else {
>            return key;
>       }
> }
>
> Do you want to collect the official list of parameters for above code
> snippet and we can try for a fix?
>
> On Thu, Jan 16, 2020 at 9:55 AM Alexander Rey <alexander....@queensu.ca>
> wrote:
>
>> Hi,
>>
>>
>>
>> I was wondering if there’s been any movement on this issues since this
>> was last raised. Mapbox is a really useful source of maps and provides a
>> WMTS interface that could be cascaded, but since GeoServer forces the key
>> name “access_key” to be uppercase, it fails the Mapbox api authentication.
>>
>>
>>
>> This doesn’t seem to be a very widespread issue, but has been raised
>> elsewhere (
>> https://gis.stackexchange.com/questions/326612/auth-error-cascading-mapbox-wmts-with-geoserver).
>> It also poses an issue when authenticating using the MapTiler service.
>>
>>
>>
>> I’m not sure how feasible a fix for this would be, but since the previous
>> thread indicated it was possible, I thought I would follow up.
>>
>>
>>
>> Thanks,
>>
>> Alexander
>>
>>
>>
>> PhD. Candidate, Water Resources Engineering
>>
>> Department of Civil Engineering, Queen’s University
>> Kingston ON, Canada  K7L 3N6
>>
>> Phone: 519-755-1728
>>
>> Email: alexander....@queensu.ca
>>
>>
>> _______________________________________________
>> Geoserver-users mailing list
>>
>> Please make sure you read the following two resources before posting to
>> this list:
>> - Earning your support instead of buying it, but Ian Turton:
>> http://www.ianturton.com/talks/foss4g.html#/
>> - The GeoServer user list posting guidelines:
>> http://geoserver.org/comm/userlist-guidelines.html
>>
>> If you want to request a feature or an improvement, also see this:
>> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>>
>>
>> Geoserver-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>>
> _______________________________________________
> Geoserver-users mailing list
>
> Please make sure you read the following two resources before posting to
> this list:
> - Earning your support instead of buying it, but Ian Turton:
> http://www.ianturton.com/talks/foss4g.html#/
> - The GeoServer user list posting guidelines:
> http://geoserver.org/comm/userlist-guidelines.html
>
> If you want to request a feature or an improvement, also see this:
> https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer
>
>
> Geoserver-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geoserver-users
>


-- 

Regards, Andrea Aime == GeoServer Professional Services from the experts!
Visit http://goo.gl/it488V for more information. == Ing. Andrea Aime
@geowolf Technical Lead GeoSolutions S.A.S. Via di Montramito 3/A 55054
Massarosa (LU) phone: +39 0584 962313 fax: +39 0584 1660272 mob: +39 339
8844549 http://www.geo-solutions.it http://twitter.com/geosolutions_it
------------------------------------------------------- *Con riferimento
alla normativa sul trattamento dei dati personali (Reg. UE 2016/679 -
Regolamento generale sulla protezione dei dati “GDPR”), si precisa che ogni
circostanza inerente alla presente email (il suo contenuto, gli eventuali
allegati, etc.) è un dato la cui conoscenza è riservata al/i solo/i
destinatario/i indicati dallo scrivente. Se il messaggio Le è giunto per
errore, è tenuta/o a cancellarlo, ogni altra operazione è illecita. Le
sarei comunque grato se potesse darmene notizia. This email is intended
only for the person or entity to which it is addressed and may contain
information that is privileged, confidential or otherwise protected from
disclosure. We remind that - as provided by European Regulation 2016/679
“GDPR” - copying, dissemination or use of this e-mail or the information
herein by anyone other than the intended recipient is prohibited. If you
have received this email by mistake, please notify us immediately by
telephone or e-mail.*
_______________________________________________
Geoserver-users mailing list

Please make sure you read the following two resources before posting to this 
list:
- Earning your support instead of buying it, but Ian Turton: 
http://www.ianturton.com/talks/foss4g.html#/
- The GeoServer user list posting guidelines: 
http://geoserver.org/comm/userlist-guidelines.html

If you want to request a feature or an improvement, also see this: 
https://github.com/geoserver/geoserver/wiki/Successfully-requesting-and-integrating-new-features-and-improvements-in-GeoServer


Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to