Skip to content
Snippets Groups Projects
Commit b1025621 authored by Thomas Gehrmann [InvitedE]'s avatar Thomas Gehrmann [InvitedE]
Browse files

Merge branch 'master' into 118-osdu-dd-delivery-m15

parents b62bbd6b a57222eb
No related branches found
No related tags found
1 merge request!407OSDU-DD-Delivery-M15 (v0.18.0)
Checking pipeline status
// Copyright © Amazon Web Services
//
// 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.schema.provider.aws.impl.messagebus;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
......
// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
// Copyright MongoDB, Inc or its affiliates. All Rights Reserved.
//
// 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.schema.provider.aws.impl.schemainfostore.mongo.config;
import org.opengroup.osdu.core.aws.mongodb.AbstractMultiClusteredConfigReader;
......
// Copyright © Amazon Web Services
//
// 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.schema.provider.aws.security;
import org.opengroup.osdu.core.aws.entitlements.Authorizer;
import org.opengroup.osdu.core.aws.entitlements.RequestKeys;
import org.opengroup.osdu.core.aws.ssm.SSMUtil;
import org.opengroup.osdu.core.common.model.http.AppException;
......@@ -26,14 +39,12 @@ public class AuthorizationServiceForServiceAdminImpl implements IAuthorizationSe
@Value("${aws.environment}")
private String awsEnvironment;
Authorizer authorizer;
String memberEmail=null;
SSMUtil ssmUtil = null;
String spu_email=null;
@PostConstruct
public void init() {
authorizer = new Authorizer(awsRegion, awsEnvironment);
if (ssmUtil == null) {
ssmUtil = new SSMUtil("/osdu/" + awsEnvironment + "/");
}
......@@ -58,7 +69,7 @@ public class AuthorizationServiceForServiceAdminImpl implements IAuthorizationSe
}
memberEmail = authorizer.validateJWT(authorizationContents);
memberEmail = headers.getUserId();
if(memberEmail == null){
throw AppException.createUnauthorized("Unauthorized. The JWT token could not be validated");
} else if(memberEmail.equals(spu_email)){
......
// Copyright © Amazon Web Services
//
// 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.schema.provider.aws.security;
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
......
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