sergehuber commented on code in PR #760: URL: https://github.com/apache/unomi/pull/760#discussion_r3362963245
########## api/src/main/java/org/apache/unomi/api/tenants/ApiKey.java: ########## @@ -0,0 +1,204 @@ +/* + * 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.unomi.api.tenants; + +import org.apache.unomi.api.Item; + +import java.util.Date; + +/** + * Represents an API key for tenant authentication and authorization. + * This class extends the base Item class and provides functionality for managing + * API keys including their lifecycle (creation, expiration, revocation) and metadata. + */ +public class ApiKey extends Item { + /** + * The item type for an API key. + */ + public static final String ITEM_TYPE = "apiKey"; + + /** + * Enum defining the types of API keys. + */ + public enum ApiKeyType { + /** + * Public API key for context.json, event collector and other public-facing endpoints + */ + PUBLIC, + + /** + * Private API key for protected endpoints including login and updateProperties + */ + PRIVATE + } + + /** + * The API key value. + */ + private String key; Review Comment: Thanks for flagging this. We've raised [UNOMI-938](https://issues.apache.org/jira/browse/UNOMI-938) to track the fix that will be part of another PR before release of Unomi 3.1.0 -- 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. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
