Skip to content

Commit

Permalink
[FSTORE-1299] Add feature store scope to elastic jwt endpoint (3.7) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
kennethmhc authored Apr 7, 2024
1 parent fd39e04 commit 1fa5705
Showing 1 changed file with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -41,16 +41,16 @@

import com.google.common.base.Strings;
import io.hops.hopsworks.api.auth.key.ApiKeyRequired;
import io.hops.hopsworks.api.opensearch.featurestore.OpenSearchFeaturestoreBuilder;
import io.hops.hopsworks.api.opensearch.featurestore.OpenSearchFeaturestoreDTO;
import io.hops.hopsworks.api.opensearch.featurestore.OpenSearchFeaturestoreRequest;
import io.hops.hopsworks.api.filter.AllowedProjectRoles;
import io.hops.hopsworks.api.filter.Audience;
import io.hops.hopsworks.api.jwt.OpenSearchJWTResponseDTO;
import io.hops.hopsworks.api.jwt.JWTHelper;
import io.hops.hopsworks.api.jwt.OpenSearchJWTResponseDTO;
import io.hops.hopsworks.api.opensearch.featurestore.OpenSearchFeaturestoreBuilder;
import io.hops.hopsworks.api.opensearch.featurestore.OpenSearchFeaturestoreDTO;
import io.hops.hopsworks.api.opensearch.featurestore.OpenSearchFeaturestoreRequest;
import io.hops.hopsworks.common.opensearch.FeaturestoreDocType;
import io.hops.hopsworks.exceptions.OpenSearchException;
import io.hops.hopsworks.exceptions.GenericException;
import io.hops.hopsworks.exceptions.OpenSearchException;
import io.hops.hopsworks.exceptions.ServiceException;
import io.hops.hopsworks.jwt.annotation.JWTRequired;
import io.hops.hopsworks.persistence.entity.user.Users;
@@ -216,7 +216,8 @@ public Response featurestoreSearch(
@AllowedProjectRoles({AllowedProjectRoles.DATA_SCIENTIST, AllowedProjectRoles.DATA_OWNER})
@JWTRequired(acceptedTokens = {Audience.API, Audience.JOB},
allowedUserRoles = {"HOPS_ADMIN", "HOPS_USER", "HOPS_SERVICE_USER"})
@ApiKeyRequired(acceptedScopes = {ApiScope.PYTHON_LIBRARIES}, allowedUserRoles = {"HOPS_ADMIN", "HOPS_USER",
@ApiKeyRequired(acceptedScopes = {ApiScope.PYTHON_LIBRARIES, ApiScope.FEATURESTORE},
allowedUserRoles = {"HOPS_ADMIN", "HOPS_USER",
"HOPS_SERVICE_USER"})
public Response createJwtToken(@Context SecurityContext sc,
@PathParam("projectId") Integer projectId) throws OpenSearchException {

0 comments on commit 1fa5705

Please sign in to comment.