GUACAMOLE-579: Change fromAttribute to canonicalize

This commit is contained in:
Virtually Nick
2019-06-21 12:54:42 -04:00
parent d8db630dbd
commit a6601a2bfd
5 changed files with 41 additions and 74 deletions

View File

@@ -1,33 +0,0 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.guacamole.auth.cas;
import org.apache.guacamole.token.TokenName;
/**
* Utility class for generating parameter token names.
*/
public class CASTokenName extends TokenName {
public static String fromAttribute(String name) {
return fromAttribute(name, "CAS_");
}
}

View File

@@ -119,7 +119,7 @@ public class TicketValidationService {
// Convert remaining attributes that have values to Strings
for (Entry <String, Object> attr : ticketAttrs.entrySet()) {
String tokenName = TokenName.fromAttribute(attr.getKey(),
String tokenName = TokenName.canonicalize(attr.getKey(),
CAS_ATTRIBUTE_TOKEN_PREFIX);
Object value = attr.getValue();
if (value != null)