[ 
https://issues.apache.org/jira/browse/KNOX-3020?focusedWorklogId=909867&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-909867
 ]

ASF GitHub Bot logged work on KNOX-3020:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 14/Mar/24 11:42
            Start Date: 14/Mar/24 11:42
    Worklog Time Spent: 10m 
      Work Description: smolnar82 commented on code in PR #881:
URL: https://github.com/apache/knox/pull/881#discussion_r1524697107


##########
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenMetadata.java:
##########
@@ -142,6 +139,32 @@ public Instant getLastUsedAt() {
     return lastUsedAt == null ? null : Instant.parse(lastUsedAt);
   }
 
+  public void setType(String type) {

Review Comment:
   Ack.



##########
gateway-spi/src/main/java/org/apache/knox/gateway/services/security/token/TokenMetadata.java:
##########
@@ -32,14 +32,18 @@
 import com.fasterxml.jackson.annotation.JsonIgnore;
 
 public class TokenMetadata {
+  public enum Type {
+    JWT, KNOXSSO_COOKIE, CLIENT_ID
+  }
+
   public static final String USER_NAME = "userName";
   public static final String COMMENT = "comment";
   public static final String ENABLED = "enabled";
   public static final String PASSCODE = "passcode";
   public static final String CREATED_BY = "createdBy";
-  public static final String KNOX_SSO_COOKIE = "knoxSSOCookie";
   public static final String LAST_USED_AT = "lastUsedAt";
-  private static final List<String> KNOWN_MD_NAMES = Arrays.asList(USER_NAME, 
COMMENT, ENABLED, PASSCODE, CREATED_BY, KNOX_SSO_COOKIE, LAST_USED_AT);
+  public static final String TYPE = "type";

Review Comment:
   The enum is TokenMetadata.Type. Let me figure out something.





Issue Time Tracking
-------------------

    Worklog Id:     (was: 909867)
    Time Spent: 0.5h  (was: 20m)

> Introduce type Knox Token metadata
> ----------------------------------
>
>                 Key: KNOX-3020
>                 URL: https://issues.apache.org/jira/browse/KNOX-3020
>             Project: Apache Knox
>          Issue Type: Task
>    Affects Versions: 2.1.0
>            Reporter: Sandor Molnar
>            Assignee: Sandor Molnar
>            Priority: Major
>             Fix For: 2.1.0
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> With KNOX-3016, there is a need to distinguish different Knox Token types as 
> follows:
>  * JWT (default)
>  * KNOXSSO_COOKIE
>  * CLIENT_ID
> This little refactor will allow us to handle every type-related decision 
> within the scope of the\{{TokenMetadata}} class.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to