roryqi commented on code in PR #13863: URL: https://github.com/apache/gravitino/pull/13863#discussion_r4283508968
########## common/src/main/java/org/apache/gravitino/dto/responses/TagNameListResponse.java: ########## @@ -0,0 +1,58 @@ +/* + * 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.gravitino.dto.responses; + +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.EqualsAndHashCode; +import lombok.ToString; + +/** Represents a response for a list of tag names. */ +@ToString +@EqualsAndHashCode(callSuper = true) +public class TagNameListResponse extends NameListResponse { + + @JsonProperty("hasInaccessibleTags") + private final boolean hasInaccessibleTags; + + /** + * Creates a new TagNameListResponse. + * + * @param names The list of accessible tag names. + * @param hasInaccessibleTags Whether inaccessible tags were omitted from the response. + */ + public TagNameListResponse(String[] names, boolean hasInaccessibleTags) { + super(names); + this.hasInaccessibleTags = hasInaccessibleTags; + } + + /** Constructor used by Jackson deserializer. */ + public TagNameListResponse() { + super(); + this.hasInaccessibleTags = false; + } + + /** + * Returns whether inaccessible tags were omitted from the response. + * + * @return true if at least one inaccessible tag was omitted, false otherwise + */ + public boolean hasInaccessibleTags() { Review Comment: Addressed in fa15ab2844. Added backward-compatible Java APIs returning TagList/PolicyList with the visible items and inaccessible-association indicator, while keeping the existing array-returning methods unchanged. Added the equivalent Python TagList APIs for tags. The authorization tests now exercise these public APIs instead of reading REST DTOs directly, and client unit tests cover the compatibility defaults and propagated flags. ########## docs/open-api/tags.yaml: ########## @@ -781,6 +781,18 @@ components: selector: $ref: "./policies.yaml#/components/schemas/PolicyAssociationSelector" + TagNameListResponse: + allOf: + - $ref: "./openapi.yaml#/components/schemas/NameListResponse" + - type: object + required: + - names + - hasInaccessibleTags + properties: + hasInaccessibleTags: + type: boolean + description: Whether one or more inaccessible tags were omitted from the response Review Comment: Addressed in fa15ab2844. Updated both management guides to document the four visible-list/indicator combinations, all-inaccessible response examples, inherited association behavior before authorization filtering, and the supported Java and Python APIs. The documentation build passes. -- 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]
