Commit bb8028e7 authored by Alan Braz's avatar Alan Braz Committed by David Diederich
Browse files

Make the global exception mapper log a useful stacktrace

The trace to the exception mapper is completely irrelevant for
all debuggind purposes
parent 0162c66d
variables:
IBM_TENANT_NAME: opendes
IBM_BUILD_SUBDIR: .
include:
- project: "osdu/platform/ci-cd-pipelines"
file: "standard-setup.yml"
......@@ -7,9 +11,12 @@ include:
- project: "osdu/platform/ci-cd-pipelines"
file: "scanners/fossa.yml"
- project: "osdu/platform/ci-cd-pipelines"
file: "scanners/gitlab-ultimate.yml"
- project: "osdu/platform/ci-cd-pipelines"
file: "publishing/pages.yml"
- project: 'osdu/platform/ci-cd-pipelines'
file: 'cloud-providers/ibm.yml'
......@@ -2,17 +2,27 @@
Generated by fossa-cli (https://github.com/fossas/fossa-cli).
This software includes the following software and licenses:
========================================================================
Apache-1.1
========================================================================
The following software have components provided under the terms of this license:
- StAX (from http://stax.codehaus.org/)
========================================================================
Apache-2.0
========================================================================
The following software have components provided under the terms of this license:
- AMQP 1.0 JMS Spring Boot AutoConfiguration (from https://repo1.maven.org/maven2/org/amqphub/spring/amqp-10-jms-spring-boot-autoconfigure)
- AMQP 1.0 JMS Spring Boot Starter (from https://repo1.maven.org/maven2/org/amqphub/spring/amqp-10-jms-spring-boot-starter)
- ASM Core (from )
- ASM based accessors helper used by json-smart (from )
- Apache Commons Codec (from http://commons.apache.org/proper/commons-codec/)
- Apache Commons Collections (from http://commons.apache.org/proper/commons-collections/)
- Apache Commons Lang (from http://commons.apache.org/proper/commons-lang/)
- Apache Commons Logging (from http://commons.apache.org/proper/commons-logging/)
- Apache Geronimo JMS Spec 2.0 (from http://geronimo.apache.org/maven/${siteId}/${version})
- Apache Groovy (from http://groovy-lang.org)
- Apache Groovy (from http://groovy-lang.org)
- Apache HttpAsyncClient (from http://hc.apache.org/httpcomponents-asyncclient)
......@@ -37,10 +47,6 @@ The following software have components provided under the terms of this license:
- Guava: Google Core Libraries for Java (from https://github.com/google/guava.git)
- HPPC Collections (from http://labs.carrotsearch.com)
- Hibernate Validator Engine (from )
- IBM COS Java SDK for Amazon S3 (from https://github.com/ibm/ibm-cos-sdk-java)
- IBM COS Java SDK for COS KMS (from https://github.com/ibm/ibm-cos-sdk-java)
- IBM COS SDK For Java (from https://github.com/ibm/ibm-cos-sdk-java)
- IBM COS SDK for Java - Core (from https://github.com/ibm/ibm-cos-sdk-java)
- J2ObjC Annotations (from https://github.com/google/j2objc/)
- JAX-RS 2.1: The Java(TM) API for RESTful Web Services (from )
- JBoss Logging 3 (from http://www.jboss.org)
......@@ -113,14 +119,15 @@ The following software have components provided under the terms of this license:
- Okio (from )
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- OpenCensus (from https://github.com/census-instrumentation/opencensus-java)
- QpidJMS Client (from )
- RESTEasy JAX-RS Client (from )
- RESTEasy JAX-RS Implementation (from )
- RESTEasy JAXB Provider (from )
- RESTEasy Jackson 2 Provider (from )
- RabbitMQ Java Client (from http://www.rabbitmq.com)
- Reactive Object Pool (from https://github.com/reactor/reactor-pool)
- Reactive Streams Netty driver (from https://github.com/reactor/reactor-netty)
- Resteasy Multipart Provider (from )
- Simple XML (from http://simple.sourceforge.net)
- SnakeYAML (from http://www.snakeyaml.org)
- Spring AOP (from https://github.com/spring-projects/spring-framework)
- Spring Beans (from https://github.com/spring-projects/spring-framework)
......@@ -138,11 +145,16 @@ The following software have components provided under the terms of this license:
- Spring Context (from https://github.com/spring-projects/spring-framework)
- Spring Core (from https://github.com/spring-projects/spring-framework)
- Spring Expression Language (SpEL) (from https://github.com/spring-projects/spring-framework)
- Spring JMS (from https://github.com/spring-projects/spring-framework)
- Spring Messaging (from https://github.com/spring-projects/spring-framework)
- Spring Plugin - Core (from )
- Spring Plugin - Metadata Extension (from )
- Spring TestContext Framework (from https://github.com/spring-projects/spring-framework)
- Spring Transaction (from https://github.com/spring-projects/spring-framework)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- Spring Web MVC (from https://github.com/spring-projects/spring-framework)
- StAX (from http://stax.codehaus.org/)
- StAX API (from http://stax.codehaus.org/)
- T-Digest (from https://github.com/tdunning/t-digest)
- aggs-matrix-stats (from https://github.com/elastic/elasticsearch)
- cli (from https://github.com/elastic/elasticsearch)
......@@ -150,7 +162,6 @@ The following software have components provided under the terms of this license:
- elasticsearch-core (from https://github.com/elastic/elasticsearch)
- fastinfoset (from http://fi.java.net)
- io.grpc:grpc-context (from https://github.com/grpc/grpc-java)
- ion-java (from https://github.com/amznlabs/ion-java/)
- jackson-databind (from http://github.com/FasterXML/jackson)
- java-cloudant (from https://cloudant.com)
- java-cloudant (from https://cloudant.com)
......@@ -158,8 +169,10 @@ The following software have components provided under the terms of this license:
- json-patch (from https://github.com/fge/json-patch)
- lang-mustache (from https://github.com/elastic/elasticsearch)
- lettuce (from http://github.com/mp911de/lettuce/wiki)
- minio (from https://github.com/minio/minio-java)
- org.xmlunit:xmlunit-core (from http://www.xmlunit.org/)
- parent-join (from https://github.com/elastic/elasticsearch)
- proton-j (from )
- rank-eval (from https://github.com/elastic/elasticsearch)
- rest (from https://github.com/elastic/elasticsearch)
- rest-high-level (from https://github.com/elastic/elasticsearch)
......@@ -194,6 +207,7 @@ The following software have components provided under the terms of this license:
- Hamcrest Core (from http://hamcrest.org/)
- Lucene Common Analyzers (from )
- StAX (from http://stax.codehaus.org/)
- fastinfoset (from http://fi.java.net)
========================================================================
......@@ -219,6 +233,7 @@ CC-BY-3.0
========================================================================
The following software have components provided under the terms of this license:
- "Java Concurrency in Practice" book annotations (from http://jcip.net/)
- FindBugs-jsr305 (from http://findbugs.sourceforge.net/)
========================================================================
......@@ -276,7 +291,6 @@ The following software have components provided under the terms of this license:
- Java Architecture for XML Binding 2.3 (from )
- JavaBeans Activation Framework API jar (from )
- JavaMail API (from )
- RabbitMQ Java Client (from http://www.rabbitmq.com)
- TXW2 Runtime (from )
- fastinfoset (from http://fi.java.net)
- istack common utility code runtime (from )
......@@ -302,7 +316,6 @@ The following software have components provided under the terms of this license:
- Java Architecture for XML Binding 2.3 (from )
- JavaBeans Activation Framework API jar (from )
- JavaMail API (from )
- RabbitMQ Java Client (from http://www.rabbitmq.com)
- TXW2 Runtime (from )
- fastinfoset (from http://fi.java.net)
- istack common utility code runtime (from )
......@@ -332,6 +345,7 @@ The following software have components provided under the terms of this license:
- Logback Classic Module (from )
- Logback Core Module (from )
- Msg Simple (from https://github.com/fge/msg-simple)
- SpotBugs Annotations (from https://spotbugs.github.io/)
- json-patch (from https://github.com/fge/json-patch)
========================================================================
......@@ -340,6 +354,7 @@ LGPL-2.1-or-later
The following software have components provided under the terms of this license:
- SnakeYAML (from http://www.snakeyaml.org)
- SpotBugs Annotations (from https://spotbugs.github.io/)
========================================================================
LGPL-3.0-only
......@@ -350,7 +365,6 @@ The following software have components provided under the terms of this license:
- BTF (from https://github.com/fge/btf)
- Jackson CoreUtils (from https://github.com/fge/jackson-coreutils)
- Msg Simple (from https://github.com/fge/msg-simple)
- RabbitMQ Java Client (from http://www.rabbitmq.com)
- json-patch (from https://github.com/fge/json-patch)
========================================================================
......@@ -376,7 +390,6 @@ MPL-1.1
The following software have components provided under the terms of this license:
- Javassist (from http://www.javassist.org/)
- RabbitMQ Java Client (from http://www.rabbitmq.com)
========================================================================
MPL-2.0
......@@ -384,7 +397,6 @@ MPL-2.0
The following software have components provided under the terms of this license:
- Javassist (from http://www.javassist.org/)
- RabbitMQ Java Client (from http://www.rabbitmq.com)
========================================================================
PHP-3.01
......@@ -422,7 +434,6 @@ The following software have components provided under the terms of this license:
- Keycloak Common (from )
- Project Lombok (from https://projectlombok.org)
- RESTEasy JAX-RS Implementation (from )
- RabbitMQ Java Client (from http://www.rabbitmq.com)
- Spring Web (from https://github.com/spring-projects/spring-framework)
- TXW2 Runtime (from )
- reactive-streams (from http://www.reactive-streams.org/)
......@@ -439,7 +450,6 @@ The following software have components provided under the terms of this license:
- Jackson CoreUtils (from https://github.com/fge/jackson-coreutils)
- JavaBeans Activation Framework (from )
- Msg Simple (from https://github.com/fge/msg-simple)
- RabbitMQ Java Client (from http://www.rabbitmq.com)
- json-patch (from https://github.com/fge/json-patch)
<?xml version="1.0" encoding="UTF-8"?>
<!--
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.
-->
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>os-core</id>
<username>os-core</username>
<!-- Treat this auth token like a password. Do not share it with anyone, including Microsoft support. -->
<!-- The generated token expires on or before 11/14/2019 -->
<password>${VSTS_FEED_TOKEN}</password>
</server>
</servers>
</settings>
......@@ -53,9 +53,10 @@
<springfox-version>2.7.0</springfox-version>
<reactor.netty.version>0.9.0.RELEASE</reactor.netty.version>
<reactor.core.version>3.3.0.RELEASE</reactor.core.version>
<osdu.ibmcore.version>0.0.13-SNAPSHOT</osdu.ibmcore.version>
<version.keycloak>9.0.0</version.keycloak>
<org.jboss.logging.provider>slf4j</org.jboss.logging.provider>
<osdu.ibmcore.version>0.0.14-SNAPSHOT</osdu.ibmcore.version>
<version.keycloak>9.0.0</version.keycloak>
<org.jboss.logging.provider>slf4j</org.jboss.logging.provider>
<start-class>org.opengroup.osdu.ibm.entitlements.EntitlementsApplication</start-class>
</properties>
<licenses>
......@@ -92,7 +93,6 @@
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-core</artifactId>
<version>9.0.21</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
......@@ -196,8 +196,37 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>${start-class}</mainClass>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<classifier>spring-boot</classifier>
<mainClass>${start-class}</mainClass>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>local</id>
<activation>
<activeByDefault>false</activeByDefault>
</activation>
<properties>
<build.profile.id>local</build.profile.id>
<profileActive>local</profileActive>
</properties>
</profile>
</profiles>
</project>
......@@ -49,7 +49,6 @@ public class EntitlementsApi {
}
@GetMapping("/groups")
@RolesAllowed("ROLE_service.entitlements.viewer")
public ResponseEntity<Groups> getGroups() {
Groups groups = entitlementsIBM.getGroups();
return new ResponseEntity<Groups>(groups, HttpStatus.OK);
......
// 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.
package org.opengroup.osdu.ibm.entitlements.model;
public class EntitlementsRole {
private EntitlementsRole() { }
public static final String PREFIX = "ROLE_";
public static final String ADMIN = "service.entitlements.admin";
public static final String ROLE_ADMIN = PREFIX + ADMIN;
}
......@@ -42,14 +42,6 @@ public class EntitlementsAuthenticationProvider implements AuthenticationProvide
grantedAuthorities.add(new KeycloakRole(role));
}
if (!token.getAccount().getRoles().contains("service.entitlements.viewers")) {
logger.info("User token does not contain required roles, calling keycloak to look for additional roles");
for (String role : query.getRolesForAuth(authentication)) {
logger.debug("Adding role {}", role);
grantedAuthorities.add(new KeycloakRole(role));
}
}
return new KeycloakAuthenticationToken(token.getAccount(), token.isInteractive(), mapAuthorities(grantedAuthorities));
}
private Collection<? extends GrantedAuthority> mapAuthorities(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment