[
https://issues.apache.org/jira/browse/KNOX-2399?focusedWorklogId=458673&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-458673
]
ASF GitHub Bot logged work on KNOX-2399:
----------------------------------------
Author: ASF GitHub Bot
Created on: 14/Jul/20 14:32
Start Date: 14/Jul/20 14:32
Worklog Time Spent: 10m
Work Description: pzampino commented on a change in pull request #361:
URL: https://github.com/apache/knox/pull/361#discussion_r454400403
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/token/impl/ZookeeperTokenStateService.java
##########
@@ -0,0 +1,52 @@
+/*
+ * 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.knox.gateway.services.token.impl;
+
+import static org.apache.knox.gateway.services.ServiceType.ALIAS_SERVICE;
+
+import java.util.Map;
+
+import org.apache.knox.gateway.config.GatewayConfig;
+import org.apache.knox.gateway.services.GatewayServices;
+import org.apache.knox.gateway.services.ServiceLifecycleException;
+import org.apache.knox.gateway.services.factory.AliasServiceFactory;
+import
org.apache.knox.gateway.services.security.impl.ZookeeperRemoteAliasService;
+
+/**
+ * A Zookeeper Token State Service is actually an Alias based TSS where the
'alias service' happens to be the 'zookeeper' implementation.
+ * This means the only important thing that should be overridden here is the
init method where the underlying alias service is configured
+ * properly.
+ */
+public class ZookeeperTokenStateService extends AliasBasedTokenStateService {
Review comment:
I know it's a bit more work, but can you extend
AliasBasedTokenStateServiceTest to exercise this new implementation?
##########
File path:
gateway-server/src/test/java/org/apache/knox/gateway/services/factory/TokenStateServiceFactoryTest.java
##########
@@ -43,22 +44,31 @@ public void testBasics() throws Exception {
@Test
public void shouldReturnDefaultAliasService() throws Exception {
Review comment:
Method name indicates an alias service test, but the implementation is a
TokenStateService test.
##########
File path:
gateway-server/src/main/java/org/apache/knox/gateway/services/factory/TokenStateServiceFactory.java
##########
@@ -61,6 +64,7 @@ protected ServiceType getServiceType() {
@Override
protected Collection<String> getKnownImplementations() {
- return unmodifiableList(asList(DefaultTokenStateService.class.getName(),
AliasBasedTokenStateService.class.getName(),
JournalBasedTokenStateService.class.getName()));
+ return unmodifiableList(asList(DefaultTokenStateService.class.getName(),
AliasBasedTokenStateService.class.getName(),
JournalBasedTokenStateService.class.getName(),
Review comment:
This is not necessarily directly related to this PR, but why isn't the
ServiceLoader mechanism used for identifying service implementations available
on the classpath?
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 458673)
Time Spent: 2h (was: 1h 50m)
> Implement ZK token state service
> --------------------------------
>
> Key: KNOX-2399
> URL: https://issues.apache.org/jira/browse/KNOX-2399
> Project: Apache Knox
> Issue Type: Task
> Affects Versions: 1.4.0
> Reporter: Sandor Molnar
> Assignee: Sandor Molnar
> Priority: Major
> Fix For: 1.5.0
>
> Time Spent: 2h
> Remaining Estimate: 0h
>
> Implement a new {{TokenStateService}} implementation which stores/fetches
> token related metadata in Zookeeper. The new service should be configurable
> to directly go to Zookeeper or use some local cache (e.g. a local alias
> service).
--
This message was sent by Atlassian Jira
(v8.3.4#803005)