Skip to content
Snippets Groups Projects
Commit 94bef99b authored by Riabokon Stanislav(EPAM)[GCP]'s avatar Riabokon Stanislav(EPAM)[GCP]
Browse files

Merge branch 'gcp-remove-cacheGroup' into 'master'

Removed GroupCache (GONRG-6554)

See merge request !321
parents 87c2eb7b 71aea886
No related branches found
No related tags found
1 merge request!321Removed GroupCache (GONRG-6554)
Pipeline #169834 failed
/*
* Copyright 2020-2023 Google LLC
* Copyright 2020-2023 EPAM Systems, Inc
*
* Licensed 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.opengroup.osdu.register.provider.gcp.cache;
import org.opengroup.osdu.core.common.model.entitlements.AuthorizationResponse;
import org.opengroup.osdu.register.di.GroupVmCache;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Component;
// Group cache is used in common part. According to the current Google Cloud architecture, we don't
// use cache. Thus, methods are empty.
@Primary
@Component
public class GcGroupCache extends GroupVmCache {
public GcGroupCache(
@Value("${app.maxExpireTime:60}") int maxExpireTime,
@Value("${app.maxCacheSize:1000}") int maxCacheSize) {
super(maxExpireTime, maxCacheSize);
}
@Override
public void put(String key, AuthorizationResponse authorizationResponse) {
// do nothing
}
@Override
public AuthorizationResponse get(String key) {
return null;
}
@Override
public void delete(String key) {
// do nothing
}
@Override
public void clearAll() {
// do nothing
}
}
......@@ -45,6 +45,7 @@ public class AuthorizationFilter {
@Autowired
private ServiceRequestInfo requestInfo;
@Autowired
//TODO: use interface ICache<K, V>
private GroupVmCache groupVmCache;
public boolean hasAnyPermission(String... requiredRoles) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment