Skip to content

Commit

Permalink
Fix TODO application: (#2708)
Browse files Browse the repository at this point in the history
- WebSecurity needs to be passed config.get("security") to take the "security.web-server" configuration
 - Added outbound configuration for the google login
 - Upgraded cassandra driver to fix issues with old guava dependencies
 - Removed metrics to avoid issues with cassandra driver.

Fixes #2707
  • Loading branch information
romain-grecourt authored Feb 2, 2021
1 parent 8feb893 commit 34bbad1
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 15 deletions.
15 changes: 8 additions & 7 deletions examples/todo-app/backend/pom.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright (c) 2018, 2020 Oracle and/or its affiliates. All rights reserved.
Copyright (c) 2018, 2021 Oracle and/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.
Expand Down Expand Up @@ -37,7 +37,7 @@

<properties>
<mainClass>io.helidon.demo.todos.backend.Main</mainClass>
<version.lib.cassandra>3.4.0</version.lib.cassandra>
<version.lib.cassandra>3.10.2</version.lib.cassandra>
</properties>

<dependencyManagement>
Expand All @@ -46,6 +46,12 @@
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
<version>${version.lib.cassandra}</version>
<exclusions>
<exclusion>
<groupId>io.dropwizard.metrics</groupId>
<artifactId>metrics-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
Expand Down Expand Up @@ -79,11 +85,6 @@
<groupId>com.datastax.cassandra</groupId>
<artifactId>cassandra-driver-core</artifactId>
</dependency>
<!-- needed by cassandra -->
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2019 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2021 Oracle and/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.
Expand Down Expand Up @@ -119,7 +119,8 @@ public class DbService {
*/
@Inject
public DbService(final Config config) {
Cluster.Builder clusterBuilder = Cluster.builder();
Cluster.Builder clusterBuilder = Cluster.builder()
.withoutMetrics();

Config cConfig = config.get("cassandra");
cConfig.get("servers").asList(Config.class).get().forEach(serverConfig -> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2021 Oracle and/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.
Expand Down Expand Up @@ -39,7 +39,6 @@ security:
- name: "http-signatures"
providers:
- google-login:
proxy-host: "www-proxy-brmdc.us.oracle.com"
client-id: "1048216952820-6a6ke9vrbjlhngbc0al0dkj9qs9tqbk2.apps.googleusercontent.com"
- abac:
- http-signatures:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, 2020 Oracle and/or its affiliates.
* Copyright (c) 2017, 2021 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -124,7 +124,7 @@ private static Routing createRouting(final Security security,
// register metrics features (on "/metrics")
.register(MetricsSupport.create())
// register security features
.register(WebSecurity.create(security, config))
.register(WebSecurity.create(security, config.get("security")))
// register static content support (on "/")
.register(StaticContentSupport.builder("/WEB").welcomeFileName("index.html"))
// register API handler (on "/api") - this path is secured (see application.yaml)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright (c) 2018, 2019 Oracle and/or its affiliates. All rights reserved.
# Copyright (c) 2018, 2021 Oracle and/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.
Expand Down Expand Up @@ -39,6 +39,9 @@ security:
providers:
- google-login:
client-id: "1048216952820-6a6ke9vrbjlhngbc0al0dkj9qs9tqbk2.apps.googleusercontent.com"
outbound:
- name: "backend"
hosts: [ "localhost", "helidon-examples-todo-backend" ]
- abac:
- http-signatures:
outbound:
Expand All @@ -49,5 +52,5 @@ security:
hmac.secret: "${CLEAR=frontend2backend}"
web-server:
paths:
- path: "/api/[{*}]"
- path: "/api/{+}"
authenticate: true

0 comments on commit 34bbad1

Please sign in to comment.