|
| 1 | +/* |
| 2 | + * SPDX-License-Identifier: Apache-2.0 |
| 3 | + * Copyright 2018-2021 The Feast Authors |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | + * you may not use this file except in compliance with the License. |
| 7 | + * You may obtain a copy of the License at |
| 8 | + * |
| 9 | + * https://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed to in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | + * See the License for the specific language governing permissions and |
| 15 | + * limitations under the License. |
| 16 | + */ |
| 17 | +package feast.serving.it; |
| 18 | + |
| 19 | +import org.springframework.boot.test.context.SpringBootTest; |
| 20 | +import org.springframework.test.context.ActiveProfiles; |
| 21 | +import org.springframework.test.context.DynamicPropertyRegistry; |
| 22 | +import org.springframework.test.context.DynamicPropertySource; |
| 23 | + |
| 24 | +@ActiveProfiles("it") |
| 25 | +@SpringBootTest |
| 26 | +public class BaseAuthBigtableIT { |
| 27 | + |
| 28 | + static final int SERVICE_START_MAX_WAIT_TIME_IN_MINUTES = 3; |
| 29 | + static final String CLIENT_ID = "client_id"; |
| 30 | + static final String CLIENT_SECRET = "client_secret"; |
| 31 | + static final String TOKEN_URL = "http://localhost:4444/oauth2/token"; |
| 32 | + static final String JWK_URI = "http://localhost:4444/.well-known/jwks.json"; |
| 33 | + |
| 34 | + static final String GRANT_TYPE = "client_credentials"; |
| 35 | + |
| 36 | + static final String AUDIENCE = "https://localhost"; |
| 37 | + |
| 38 | + static final String BIGTABLE = "bigtable_1"; |
| 39 | + static final int BIGTABLE_PORT = 8086; |
| 40 | + |
| 41 | + static final String CORE = "core_1"; |
| 42 | + static final int FEAST_CORE_PORT = 6565; |
| 43 | + |
| 44 | + @DynamicPropertySource |
| 45 | + static void properties(DynamicPropertyRegistry registry) { |
| 46 | + registry.add("feast.active_store", () -> "bigtable"); |
| 47 | + registry.add("feast.stores[0].name", () -> "bigtable"); |
| 48 | + registry.add("feast.stores[0].type", () -> "BIGTABLE"); |
| 49 | + // Redis needs to accessible by both core and serving, hence using host address |
| 50 | + registry.add("feast.stores[0].config.project_id", () -> "test-project"); |
| 51 | + registry.add("feast.stores[0].config.instance_id", () -> "test-instance"); |
| 52 | + registry.add("feast.stores[0].subscriptions[0].name", () -> "*"); |
| 53 | + registry.add("feast.stores[0].subscriptions[0].project", () -> "*"); |
| 54 | + |
| 55 | + registry.add("feast.core-authentication.options.oauth_url", () -> TOKEN_URL); |
| 56 | + registry.add("feast.core-authentication.options.grant_type", () -> GRANT_TYPE); |
| 57 | + registry.add("feast.core-authentication.options.client_id", () -> CLIENT_ID); |
| 58 | + registry.add("feast.core-authentication.options.client_secret", () -> CLIENT_SECRET); |
| 59 | + registry.add("feast.core-authentication.options.audience", () -> AUDIENCE); |
| 60 | + registry.add("feast.core-authentication.options.jwkEndpointURI", () -> JWK_URI); |
| 61 | + registry.add("feast.security.authentication.options.jwkEndpointURI", () -> JWK_URI); |
| 62 | + } |
| 63 | +} |
0 commit comments