Commit fc8507cc authored by Anuj Gupta's avatar Anuj Gupta
Browse files

Latest IBM Code with health check

parent 69fe7765
Pipeline #24774 passed with stages
in 10 minutes and 46 seconds
......@@ -17,4 +17,6 @@ TODO: Explain how other users and developers can contribute to make your code be
If you want to learn more about creating good readme files then refer the following [guidelines](https://docs.microsoft.com/en-us/azure/devops/repos/git/create-a-readme?view=azure-devops). You can also seek inspiration from the below readme files:
- [ASP.NET Core](https://github.com/aspnet/Home)
- [Visual Studio Code](https://github.com/Microsoft/vscode)
- [Chakra Core](https://github.com/Microsoft/ChakraCore)
\ No newline at end of file
- [Chakra Core](https://github.com/Microsoft/ChakraCore)
# github migration update
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.core.common.model.entitlements;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.core.common.model.entitlements;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.core.common.model.entitlements;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.core.common.model.entitlements;
......@@ -40,7 +15,7 @@ import lombok.NoArgsConstructor;
@NoArgsConstructor
public class MemberInfo {
String email;
//String role;
String role;
/*public static MemberInfo Owner(String email) {
return MemberInfo.builder().email(email).role(Roles.OWNER).build();
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.api;
......@@ -107,6 +82,14 @@ public class EntitlementsApi {
@PathVariable("groupEmail") GroupEmail groupEmail,
@RequestBody MemberInfo memberInfo) {
tenantInfo.getName();
if(memberInfo.getRole().trim().isEmpty()) {
throw new AppException(HttpStatus.BAD_REQUEST.value(), "Role cannot be empty", "Role cannot be empty");
}
if(!(memberInfo.getRole().equalsIgnoreCase("MEMBER") || memberInfo.getRole().equalsIgnoreCase("OWNER"))) {
throw new AppException(HttpStatus.BAD_REQUEST.value(), "Role need to be either MEMBER or OWNER", "Role need to be either MEMBER or OWNER");
}
try {
return new ResponseEntity<MemberInfo>(entitlementsIBM.addMember(groupEmail, memberInfo), HttpStatus.OK);
} catch (AppException e) {
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.api;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.api;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.di;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.model;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.security;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.security;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.security;
......
/**
* Copyright 2020 IBM Corp. 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.
*
* begin_generated_IBM_copyright_prolog
*
* *******************************************
* IBM Confidential.
* OCO Source Materials
* 5900-AEB
* © Copyright IBM Corp. 2020
* The source code for this program is not published or otherwise divested of its trade secrets, irrespective of what has
* been deposited with the U.S. Copyright Office.
*
* end_generated_IBM_copyright_prolog
*/
/* Licensed Materials - Property of IBM */
/* (c) Copyright IBM Corp. 2020. All Rights Reserved.*/
package org.opengroup.osdu.ibm.entitlements.security;
......
/**
* Copyright 2020 IBM Corp. 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.