Set access token and refresh token in Cookie with Keycloak - reactjs

In our applications, we are using a identity provider called Tilia through Keycloak.
┌────────────────┐
│ │
┌──┤ Telia OpenId ├──────┐
│ │ │ │
│ └────────────────┘ │
│ │
│ │
│ │
│ │
┌──────┴───────────┐ │
│ │ │
│ React Frontend │ │
│ │ │
└─────────┬────────┘ │
│ │
│ │
┌─────────┴───────┐ ┌───────┴──────┐
│ │ │ │
│ Spring Cloud ├───────┤ Keycloak │
│ Gateway │ │ │
│ │ └──────────────┘
└─────────┬───────┘
│
│
┌─────────┴──────────┬────────────────────┐
│ │ │
┌─────────┴────────┐ ┌─────────┴─────────┐ ┌────────┴─────────┐
│ │ │ │ │ │
│ Microservice 1 │ │ Microservice 2 │ │ Microservice 3 │
│ │ │ │ │ │
└──────────────────┘ └───────────────────┘ └──────────────────┘
We are using Authorization Code Flow to with the React web application.
User go to website login page
User clicks on "Log using Telia" button
User enter username, password and authorize
The redirect URL is <host>/auth/code, so we have a React component configured using react-router to get the authorization code from document.location.search and send a request to Keycloak to get the access token and refresh token. Tokens from the response will be stored in the Local Storage.
However, we are planning to use Cookies to store tokens instead of the LocalStorage. So, Is there a way to map response body tokens to Set-Cookie headers in Keycloak? Should I use Spring Cloud Gateway to do the mapping. Or is there any other preferred method to achieve this?

Related

Why is Aries Blueprint not registering a namespace handler for camel-cxf and camel-blueprint?

Camel 2.23.1Karaf 4.2.4
Aries Blueprint (for the outer container that registers everything)
Camel Blueprint (for Camel routes)
Camel CXF (for rsServer)
CXF Core (for access to the CXF bus property)
XML Namespaces
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:cxf="http://camel.apache.org/schema/blueprint/cxf"
xmlns:cxfcore="http://cxf.apache.org/blueprint/core"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint-2.23.1.xsd
http://camel.apache.org/schema/blueprint/cxf http://camel.apache.org/schema/cxf/camel-cxf-2.23.1-blueprint.xsd
http://cxf.apache.org/blueprint/core http://cxf.apache.org/schemas/blueprint/core.xsd"
Error blueprint namespace handlers:
Status: GracePeriod
Declarative Services
Blueprint
12.04.19, 09:00
Missing dependencies:
(&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint/cxf)) (&(objectClass=org.apache.aries.blueprint.NamespaceHandler)(osgi.service.blueprint.namespace=http://camel.apache.org/schema/blueprint))
In summary, the following are not registered by Aries Blueprint:
http://camel.apache.org/schema/blueprint
http://camel.apache.org/schema/blueprint/cxf
The blueprint runtime does not parse the blueprint xml until NamespaceHandler services can be found for every custom namespace that is used in the bundle. Unless NamespaceHandler services can be found for every custom namespace, the blueprint container is unable to process the bundle. This result can mean that the blueprint container waits indefinitely if no NamespaceHandler exists.
https://www.ibm.com/support/knowledgecenter/en/SSEQTP_liberty/com.ibm.websphere.wlp.doc/ae/rwlp_blueprint_namespace_handler.html
I know Aries Blueprint is running and registering some namespaces because of these karaf.log entries:
Registered blueprint namespace handler for http://cxf.apache.org/blueprint/bindings/soap
Registered blueprint namespace handler for http://cxf.apache.org/blueprint/simple
Registered blueprint namespace handler for http://cxf.apache.org/policy
Registered blueprint namespace handler for http://www.w3.org/ns/ws-policy
Registered blueprint namespace handler for http://www.w3.org/2006/07/ws-policy
Registered blueprint namespace handler for http://schemas.xmlsoap.org/ws/2004/09/policy
Registered blueprint namespace handler for http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd
Registered blueprint namespace handler for http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd
Registered blueprint namespace handler for http://www.w3.org/2000/09/xmldsig#
Registered blueprint namespace handler for http://docs.oasis-open.org/ws-sx/ws-securitypolicy/200702
Registered blueprint namespace handler for http://cxf.apache.org/blueprint/jaxws
Registered blueprint namespace handler for http://cxf.apache.org/blueprint/jaxrs
Registered blueprint namespace handler for http://cxf.apache.org/blueprint/jaxrs-client
Registered blueprint namespace handler for http://cxf.apache.org/blueprint/core
Registered blueprint namespace handler for http://cxf.apache.org/configuration/beans
Registered blueprint namespace handler for http://cxf.apache.org/configuration/parameterized-types
Registered blueprint namespace handler for http://cxf.apache.org/configuration/security
Registered blueprint namespace handler for http://schemas.xmlsoap.org/wsdl/
Registered blueprint namespace handler for http://www.w3.org/2005/08/addressing
Registered blueprint namespace handler for http://schemas.xmlsoap.org/ws/2004/08/addressing
Registered blueprint namespace handler for http://cxf.apache.org/transports/http-jetty/configuration
Karaf: as you can see, My Awesome Application is stuck (likely in a loop)
ID │ State │ Lvl │ Version │ Name
────┼─────────────┼─────┼─────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
23 │ Active │ 80 │ 4.2.4 │ Apache Karaf :: OSGi Services :: Event
45 │ GracePeriod │ 80 │ 1.0.0 │ My Awesome Application
46 │ Active │ 80 │ 0.0.0 │ features.xml
51 │ Active │ 80 │ 2.9.7 │ Jackson-JAXRS-base
52 │ Active │ 80 │ 2.9.7 │ Jackson-JAXRS-JSON
71 │ Active │ 50 │ 2.23.1 │ camel-blueprint
72 │ Active │ 80 │ 2.23.1 │ camel-commands-core
73 │ Active │ 50 │ 2.23.1 │ camel-core
74 │ Active │ 50 │ 2.23.1 │ camel-cxf
75 │ Active │ 50 │ 2.23.1 │ camel-cxf-transport
76 │ Active │ 50 │ 2.23.1 │ camel-http-common
77 │ Active │ 50 │ 2.23.1 │ camel-spring
78 │ Active │ 80 │ 2.23.1 │ camel-karaf-commands
102 │ Active │ 80 │ 1.1.1 │ geronimo-jms_1.1_spec
112 │ Active │ 80 │ 2.0.19 │ Apache MINA Core
144 │ Active │ 80 │ 4.12.0 │ Apache XBean OSGI Bundle Utilities
145 │ Active │ 80 │ 4.12.0 │ Apache XBean :: Classpath Resource Finder
Another intermittent error showed up regarding the HttpServer.
java.lang.ClassNotFoundException: org.osgi.service.http.HttpService not found by org.apache.cxf.cxf-rt-transports-http
My first inkling would be that this is required for the namespace handlers to validate the namespaces, but removing karaf in its entirety and reinstalling everything does not always yield this error. In fact, I get:
2019-04-12T09:45:31,438 | DEBUG | paxweb-config-1-thread-1 | pax-web-runtime | 181 - org.ops4j.pax.web.pax-web-runtime - 7.2.8 | ServiceEvent REGISTERED - [org.osgi.service.http.HttpService, org.ops4j.pax.web.service.WebContainer] - org.ops4j.pax.web.pax-web-runtime
bundle:services -p org.apache.camel.camel-blueprint
camel-blueprint (71) provides:
------------------------------
objectClass = [org.apache.aries.blueprint.NamespaceHandler]
osgi.service.blueprint.namespace = [http://camel.apache.org/schema/blueprint, http://camel.apache.org/schema/placeholder]
service.bundleid = 71
service.id = 198
service.scope = bundle
----
objectClass = [org.osgi.service.blueprint.container.BlueprintContainer]
osgi.blueprint.container.symbolicname = org.apache.camel.camel-blueprint
osgi.blueprint.container.version = 2.23.1
service.bundleid = 71
service.id = 199
service.scope = singleton
----
objectClass = [org.apache.karaf.shell.commands.info.InfoProvider]
service.bundleid = 71
service.id = 200
service.scope = singleton
list -t 0 -l
START LEVEL 100 , List Threshold: 0
ID │ State │ Lvl │ Version │ Location
────┼─────────────┼─────┼────────────────────┼──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
0 │ Active │ 0 │ 5.6.12 │ System Bundle
1 │ Resolved │ 1 │ 4.2.4 │ mvn:org.apache.karaf.features/org.apache.karaf.features.extension/4.2.4
2 │ Active │ 5 │ 1.2.2 │ mvn:org.apache.felix/org.apache.felix.metatype/1.2.2
3 │ Active │ 5 │ 4.2.4 │ mvn:org.apache.karaf.services/org.apache.karaf.services.eventadmin/4.2.4
4 │ Active │ 5 │ 2.6.1 │ mvn:org.ops4j.pax.url/pax-url-aether/2.6.1
5 │ Active │ 8 │ 1.17.1 │ mvn:org.fusesource.jansi/jansi/1.17.1
6 │ Active │ 8 │ 1.10.1 │ mvn:org.ops4j.pax.logging/pax-logging-api/1.10.1
7 │ Active │ 8 │ 1.10.1 │ mvn:org.ops4j.pax.logging/pax-logging-log4j2/1.10.1
8 │ Active │ 9 │ 1.0.2 │ mvn:org.apache.felix/org.apache.felix.coordinator/1.0.2
9 │ Active │ 10 │ 1.9.14 │ mvn:org.apache.felix/org.apache.felix.configadmin/1.9.14
10 │ Active │ 11 │ 3.6.4 │ mvn:org.apache.felix/org.apache.felix.fileinstall/3.6.4
11 │ Active │ 15 │ 4.2.4 │ mvn:org.apache.karaf.features/org.apache.karaf.features.core/4.2.4
12 │ Active │ 30 │ 2.9.0 │ mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.activation-api-1.1/2.9.0
13 │ Active │ 30 │ 1.1.5 │ mvn:org.apache.aries.jmx/org.apache.aries.jmx.api/1.1.5
14 │ Active │ 30 │ 1.1.8 │ mvn:org.apache.aries.jmx/org.apache.aries.jmx.core/1.1.8
15 │ Active │ 30 │ 1.2.0 │ mvn:org.apache.aries.jmx/org.apache.aries.jmx.whiteboard/1.2.0
16 │ Active │ 20 │ 1.1.3 │ mvn:org.apache.aries/org.apache.aries.util/1.1.3
17 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.bundle/org.apache.karaf.bundle.core/4.2.4
18 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.config/org.apache.karaf.config.core/4.2.4
19 │ Active │ 26 │ 4.2.4 │ mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.features/4.2.4
20 │ Active │ 24 │ 4.2.4 │ mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.kar/4.2.4
21 │ Active │ 24 │ 4.2.4 │ mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.wrap/4.2.4
22 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.diagnostic/org.apache.karaf.diagnostic.core/4.2.4
23 │ Active │ 80 │ 4.2.4 │ mvn:org.apache.karaf/org.apache.karaf.event/4.2.4
24 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.features/org.apache.karaf.features.command/4.2.4
25 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.instance/org.apache.karaf.instance.core/4.2.4
26 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.jaas/org.apache.karaf.jaas.command/4.2.4
27 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.jaas/org.apache.karaf.jaas.config/4.2.4
28 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.jaas/org.apache.karaf.jaas.modules/4.2.4
29 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.kar/org.apache.karaf.kar.core/4.2.4
30 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.log/org.apache.karaf.log.core/4.2.4
31 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.management/org.apache.karaf.management.server/4.2.4
32 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.package/org.apache.karaf.package.core/4.2.4
33 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.service/org.apache.karaf.service.core/4.2.4
34 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.shell/org.apache.karaf.shell.commands/4.2.4
35 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.shell/org.apache.karaf.shell.core/4.2.4
36 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.shell/org.apache.karaf.shell.ssh/4.2.4
37 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.system/org.apache.karaf.system.core/4.2.4
38 │ Active │ 30 │ 0.3.11.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.not-yet-commons-ssl/0.3.11_1
39 │ Active │ 30 │ 1.7.0 │ mvn:org.apache.sshd/sshd-core/1.7.0
40 │ Active │ 30 │ 3.10.0 │ mvn:org.jline/jline-builtins/3.10.0
41 │ Active │ 30 │ 3.10.0 │ mvn:org.jline/jline-reader/3.10.0
42 │ Active │ 30 │ 3.10.0 │ mvn:org.jline/jline-terminal/3.10.0
43 │ Resolved │ 30 │ 3.10.0 │ mvn:org.jline/jline-terminal-jansi/3.10.0
44 │ Active │ 5 │ 2.6.1 │ mvn:org.ops4j.pax.url/pax-url-wrap/2.6.1/jar/uber
45 │ Active │ 80 │ 0.0.0 │ feature:file:/usr/local/karaf/apache-karaf-4.2.4/deploy/features.xml
46 │ GracePeriod │ 90 │ 1.0.0 │ file:/usr/local/karaf/apache-karaf-4.2.4/deploy/my-awesome-application-1.0.0.jar
47 │ Active │ 35 │ 2.9.7 │ mvn:com.fasterxml.jackson.core/jackson-annotations/2.9.7
48 │ Active │ 35 │ 2.9.7 │ mvn:com.fasterxml.jackson.core/jackson-core/2.9.7
49 │ Active │ 35 │ 2.9.7 │ mvn:com.fasterxml.jackson.core/jackson-databind/2.9.7
50 │ Active │ 35 │ 2.9.7 │ mvn:com.fasterxml.jackson.dataformat/jackson-dataformat-yaml/2.9.7
51 │ Active │ 80 │ 2.9.7 │ wrap:mvn:com.fasterxml.jackson.jaxrs/...
52 │ Active │ 80 │ 2.9.7 │ wrap:mvn:com.fasterxml.jackson.jaxrs/...
53 │ Active │ 35 │ 2.9.7 │ mvn:com.fasterxml.jackson.module/jackson-module-jaxb-annotations/2.9.7
54 │ Active │ 20 │ 5.0.3 │ mvn:com.fasterxml.woodstox/woodstox-core/5.0.3
55 │ Active │ 25 │ 20.0.0 │ mvn:com.google.guava/guava/20.0
56 │ Active │ 25 │ 3.2.6 │ mvn:io.dropwizard.metrics/metrics-core/3.2.6
57 │ Active │ 10 │ 1.3 │ mvn:javax.annotation/javax.annotation-api/1.3
58 │ Active │ 30 │ 1.4.7 │ mvn:javax.mail/mail/1.4.7
59 │ Active │ 30 │ 3.1.0 │ mvn:javax.servlet/javax.servlet-api/3.1.0
60 │ Active │ 30 │ 1.1 │ mvn:javax.websocket/javax.websocket-api/1.1
61 │ Active │ 25 │ 2.9.4 │ mvn:joda-time/joda-time/2.9.4
62 │ Active │ 40 │ 2.10.5 │ mvn:net.sf.ehcache/ehcache/2.10.5
63 │ Active │ 20 │ 1.0.1 │ mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.api/1.0.1
64 │ Active │ 20 │ 1.3.1 │ mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.cm/1.3.1
65 │ Active │ 20 │ 1.10.1 │ mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core/1.10.1
66 │ Resolved │ 20 │ 1.0.0 │ mvn:org.apache.aries.blueprint/org.apache.aries.blueprint.core.compatibility/1.0.0
67 │ Active │ 30 │ 1.2.0 │ mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint.api/1.2.0
68 │ Active │ 30 │ 1.2.0 │ mvn:org.apache.aries.jmx/org.apache.aries.jmx.blueprint.core/1.2.0
69 │ Active │ 20 │ 1.1.4 │ mvn:org.apache.aries.proxy/org.apache.aries.proxy/1.1.4
70 │ Active │ 30 │ 1.2.0 │ mvn:org.apache.aries.spifly/org.apache.aries.spifly.dynamic.bundle/1.2
71 │ Active │ 50 │ 2.23.1 │ mvn:org.apache.camel/camel-blueprint/2.23.1
72 │ Active │ 80 │ 2.23.1 │ mvn:org.apache.camel/camel-commands-core/2.23.1
73 │ Active │ 50 │ 2.23.1 │ mvn:org.apache.camel/camel-core/2.23.1
74 │ Active │ 50 │ 2.23.1 │ mvn:org.apache.camel/camel-cxf/2.23.1
75 │ Active │ 50 │ 2.23.1 │ mvn:org.apache.camel/camel-cxf-transport/2.23.1
76 │ Active │ 50 │ 2.23.1 │ mvn:org.apache.camel/camel-http-common/2.23.1
77 │ Active │ 50 │ 2.23.1 │ mvn:org.apache.camel/camel-spring/2.23.1
78 │ Active │ 80 │ 2.23.1 │ mvn:org.apache.camel.karaf/camel-karaf-commands/2.23.1
79 │ Active │ 25 │ 1.11.0 │ mvn:commons-codec/commons-codec/1.11
80 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-core/3.2.7
81 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-bindings-soap/3.2.7
82 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-bindings-xml/3.2.7
83 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-databinding-aegis/3.2.7
84 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-databinding-jaxb/3.2.7
85 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-features-logging/3.2.7
86 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-frontend-jaxrs/3.2.7
87 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-frontend-jaxws/3.2.7
88 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-frontend-simple/3.2.7
89 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-management/3.2.7
90 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-rs-client/3.2.7
91 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-rs-extension-providers/3.2.7
92 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-rs-extension-search/3.2.7
93 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-rs-json-basic/3.2.7
94 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-rs-service-description/3.2.7
95 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-transports-http/3.2.7
96 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-transports-http-jetty/3.2.7
97 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-ws-policy/3.2.7
98 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf/cxf-rt-wsdl/3.2.7
99 │ Active │ 40 │ 3.2.7 │ mvn:org.apache.cxf.karaf/cxf-karaf-commands/3.2.7
100 │ Active │ 30 │ 2.1.16 │ mvn:org.apache.felix/org.apache.felix.scr/2.1.16
101 │ Active │ 30 │ 1.1 │ mvn:org.apache.geronimo.specs/geronimo-jaspic_1.0_spec/1.1
102 │ Active │ 80 │ 1.1.1 │ mvn:org.apache.geronimo.specs/geronimo-jms_1.1_spec/1.1.1
103 │ Active │ 30 │ 1.1.1 │ mvn:org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1
104 │ Active │ 9 │ 1.1 │ mvn:org.apache.geronimo.specs/geronimo-osgi-registry/1.1
105 │ Active │ 10 │ 1.1.3 │ mvn:org.apache.geronimo.specs/geronimo-ws-metadata_2.0_spec/1.1.3
106 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.bundle/org.apache.karaf.bundle.blueprintstate/4.2.4
107 │ Active │ 24 │ 4.2.4 │ mvn:org.apache.karaf.deployer/org.apache.karaf.deployer.blueprint/4.2.4
108 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.http/org.apache.karaf.http.core/4.2.4
109 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.jaas.blueprint/org.apache.karaf.jaas.blueprint.config/4.2.4
110 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.scr/org.apache.karaf.scr.management/4.2.4
111 │ Active │ 30 │ 4.2.4 │ mvn:org.apache.karaf.scr/org.apache.karaf.scr.state/4.2.4
112 │ Active │ 80 │ 2.0.19 │ mvn:org.apache.mina/mina-core/2.0.19
113 │ Active │ 30 │ 3.1.1 │ mvn:org.apache.neethi/neethi/3.1.1
114 │ Active │ 25 │ 2.1.2 │ mvn:org.apache.santuario/xmlsec/2.1.2
115 │ Active │ 30 │ 1.0.0.6 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.aopalliance/1.0_6
116 │ Active │ 30 │ 5.2.0.4 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.bcel/5.2_4
117 │ Active │ 30 │ 1.2.13.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.fastinfoset/1.2.13_1
118 │ Active │ 30 │ 1.9.2.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jasypt/1.9.2_1
119 │ Active │ 20 │ 2.2.11.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-impl/2.2.11_1
120 │ Active │ 20 │ 2.2.11.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.jaxb-xjc/2.2.11_1
121 │ Active │ 25 │ 3.3.0.2 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.opensaml/3.3.0_2
122 │ Active │ 25 │ 1.3.23.2 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.saaj-impl/1.3.23_2
123 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-aop/5.1.5.RELEASE_1
124 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-beans/5.1.5.RELEASE_1
125 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context/5.1.5.RELEASE_1
126 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-context-support/5.1.5.RELEASE_1
127 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-core/5.1.5.RELEASE_1
128 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-expression/5.1.5.RELEASE_1
129 │ Active │ 30 │ 5.1.5.RELEASE_1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.spring-tx/5.1.5.RELEASE_1
130 │ Active │ 30 │ 1.6.3.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.wsdl4j/1.6.3_1
131 │ Active │ 30 │ 2.7.2.3 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xalan/2.7.2_3
132 │ Active │ 30 │ 2.12.0.1 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xerces/2.12.0_1
133 │ Active │ 25 │ 1.2.0.5 │ mvn:org.apache.servicemix.bundles/org.apache.servicemix.bundles.xmlresolver/1.2_5
134 │ Active │ 10 │ 2.9.1 │ mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxrs-api-2.1/2.9.1
135 │ Active │ 10 │ 2.9.0 │ mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.jaxws-api-2.2/2.9.0
136 │ Active │ 10 │ 2.9.0 │ mvn:org.apache.servicemix.specs/org.apache.servicemix.specs.saaj-api-1.3/2.9.0
137 │ Active │ 30 │ 2.2.3 │ mvn:org.apache.ws.xmlschema/xmlschema-core/2.2.3
138 │ Active │ 30 │ 2.2.2 │ mvn:org.apache.wss4j/wss4j-bindings/2.2.2
139 │ Active │ 30 │ 2.2.2 │ mvn:org.apache.wss4j/wss4j-policy/2.2.2
140 │ Active │ 30 │ 2.2.2 │ mvn:org.apache.wss4j/wss4j-ws-security-common/2.2.2
141 │ Active │ 30 │ 2.2.2 │ mvn:org.apache.wss4j/wss4j-ws-security-dom/2.2.2
142 │ Active │ 30 │ 2.2.2 │ mvn:org.apache.wss4j/wss4j-ws-security-policy-stax/2.2.2
143 │ Active │ 30 │ 2.2.2 │ mvn:org.apache.wss4j/wss4j-ws-security-stax/2.2.2
144 │ Active │ 80 │ 4.12.0 │ mvn:org.apache.xbean/xbean-bundleutils/4.12
145 │ Active │ 80 │ 4.12.0 │ mvn:org.apache.xbean/xbean-finder/4.12
146 │ Active │ 30 │ 1.4.0 │ mvn:org.codehaus.jettison/jettison/1.4.0
147 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-client/9.4.12.v20180830
148 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-continuation/9.4.12.v20180830
149 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-deploy/9.4.12.v20180830
150 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-http/9.4.12.v20180830
151 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-io/9.4.12.v20180830
152 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-jaas/9.4.12.v20180830
153 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-jmx/9.4.12.v20180830
154 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-jndi/9.4.12.v20180830
155 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-plus/9.4.12.v20180830
156 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-rewrite/9.4.12.v20180830
157 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-security/9.4.12.v20180830
158 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-jaspi/9.4.12.v20180830
159 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-server/9.4.12.v20180830
160 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-servlet/9.4.12.v20180830
161 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-servlets/9.4.12.v20180830
162 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-util/9.4.12.v20180830
163 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-util-ajax/9.4.12.v20180830
164 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-webapp/9.4.12.v20180830
165 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/websocket-api/9.4.12.v20180830
166 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/websocket-client/9.4.12.v20180830
167 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/websocket-common/9.4.12.v20180830
168 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/javax-websocket-client-impl/9.4.12.v20180830
169 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/javax-websocket-server-impl/9.4.12.v20180830
170 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/websocket-server/9.4.12.v20180830
171 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty.websocket/websocket-servlet/9.4.12.v20180830
172 │ Active │ 30 │ 9.4.12.v20180830 │ mvn:org.eclipse.jetty/jetty-xml/9.4.12.v20180830
173 │ Active │ 25 │ 1.7.6 │ mvn:org.jvnet.staxex/stax-ex/1.7.6
174 │ Active │ 20 │ 7.1.0 │ mvn:org.ow2.asm/asm/7.1
175 │ Active │ 20 │ 7.1.0 │ mvn:org.ow2.asm/asm-commons/7.1
176 │ Active │ 20 │ 7.1.0 │ mvn:org.ow2.asm/asm-tree/7.1
177 │ Active │ 20 │ 7.1.0 │ mvn:org.ow2.asm/asm-analysis/7.1
178 │ Active │ 20 │ 7.1.0 │ mvn:org.ow2.asm/asm-util/7.1
179 │ Active │ 30 │ 7.2.8 │ mvn:org.ops4j.pax.web/pax-web-api/7.2.8
181 │ Active │ 30 │ 7.2.8 │ mvn:org.ops4j.pax.web/pax-web-runtime/7.2.8
182 │ Active │ 30 │ 7.2.8 │ mvn:org.ops4j.pax.web/pax-web-spi/7.2.8
183 │ Active │ 30 │ 1.0.0.201505202023 │ mvn:org.osgi/org.osgi.util.function/1.0.0
184 │ Active │ 30 │ 1.0.0.201505202023 │ mvn:org.osgi/org.osgi.util.promise/1.0.0
185 │ Active │ 35 │ 1.23.0 │ mvn:org.yaml/snakeyaml/1.23
186 │ Active │ 20 │ 3.1.4 │ mvn:org.codehaus.woodstox/stax2-api/3.1.4
187 │ Active │ 10 │ 4.4.1 │ mvn:org.codehaus.woodstox/woodstox-core-asl/4.4.1
188 │ Active │ 80 │ 1.4.23.Final │ mvn:io.undertow/undertow-core/1.4.23.Final
189 │ Active │ 80 │ 1.4.23.Final │ mvn:io.undertow/undertow-servlet/1.4.23.Final
190 │ Active │ 80 │ 1.4.23.Final │ mvn:io.undertow/undertow-websockets-jsr/1.4.23.Final
191 │ Active │ 80 │ 3.3.8.Final │ mvn:org.jboss.xnio/xnio-api/3.3.8.Final
192 │ Active │ 80 │ 3.3.8.Final │ mvn:org.jboss.xnio/xnio-nio/3.3.8.Final
193 │ Active │ 80 │ 7.2.8 │ mvn:org.ops4j.pax.web/pax-web-undertow/7.2.8
features.xml
<?xml version="1.0" encoding="UTF-8"?>
<features xmlns="http://karaf.apache.org/xmlns/features/v1.4.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://karaf.apache.org/xmlns/features/v1.4.0 http://karaf.apache.org/xmlns/features/v1.4.0"
name="my-awesome-application-features">
<repository>mvn:org.apache.camel.karaf/apache-camel/${camel.version}/xml/features</repository>
<repository>mvn:org.apache.cxf.karaf/apache-cxf/${cxf.version}/xml/features</repository>
<feature name="my-awesome-application" version="${project.version}" install="auto">
<feature version="${cxf.version}" dependency="true">cxf</feature>
<feature version="1.10.2" dependency="true">aries-blueprint</feature>
<feature version="${camel.version}" dependency="true">camel</feature>
<feature version="${camel.version}" dependency="true">camel-api</feature>
<feature version="${camel.version}" dependency="true">camel-base</feature>
<feature version="${camel.version}" dependency="true">camel-core</feature>
<feature version="${camel.version}" dependency="true">camel-cxf</feature>
<feature version="${camel.version}" dependency="true">camel-blueprint</feature>
<feature version="${camel.version}" dependency="true">camel-paxlogging</feature>
<feature version="${camel.version}" dependency="true">camel-stream</feature>
<bundle start-level="90">file:deploy/my-awesome-application-${project.version}.jar</bundle>
</feature>
</features>
Bundle is waiting for namespace handlers [http://camel.apache.org/schema/blueprint]
It is important that the Aries Blueprint (blueprint-core) and Aries Blueprint API (blueprint-api) are not declared as embedded in the MANIFEST.MF. When using the maven-bundle-plugin, this is equivalent to having a look at the pom.xml
<Embed-Dependency>
*
</Embed-Dependency>
A star here would include, for example, the blueprint-core, blueprint-api, camel-core, blueprint-blueprint. This could lead to Karaf checking the wrong namespace registry when looking for namespace handlers.
I simply removed the Kleene star * and embedded only non-OSGI packages that I needed. However, if you want a star, then there is also a solution. Because the Embed-Dependency is processed sequentially (top-down), it is possible to exclude dependencies before the star like this:
<Embed-Dependency>
!org.apache.aries.blueprint-core,
!org.apache.aries.blueprint-api,
*
</Embed-Dependency>
The star will not include pre-negated packages.
Also, it could be that two Karaf features declared in the features.xml start multiple instances of CXF, i.e. feature camel-cxf and feature cxf, which might lead to only one of them registering with the Blueprint Namespace Handler.

Npm audit shows 9 vulnerabilities upon creating a new react native project

When I create a new React native project and I run npm audit I get 9 vulnerabilities. The list of the vulnerabilities are listed in the table below:
│ High │ Denial of Service │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ ws │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >= 1.1.5 <2.0.0 || >=3.3.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ react-native > react-devtools-core > ws │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/550 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.5.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ react-native > metro > jest-haste-map > sane > fsevents > │
│ │ node-pre-gyp > rc > deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/612 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.5.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ jest-expo > jest > jest-cli > jest-haste-map > sane > │
│ │ fsevents > node-pre-gyp > rc > deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/612 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.5.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ jest-expo > jest > jest-cli > jest-runner > jest-haste-map > │
│ │ sane > fsevents > node-pre-gyp > rc > deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/612 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.5.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ jest-expo > jest > jest-cli > jest-runner > jest-runtime > │
│ │ jest-haste-map > sane > fsevents > node-pre-gyp > rc > │
│ │ deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/612 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=0.5.1 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ jest-expo │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ jest-expo > jest > jest-cli > jest-runtime > jest-haste-map │
│ │ > sane > fsevents > node-pre-gyp > rc > deep-extend │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/612 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Prototype pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ hoek │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ > 4.2.0 < 5.0.0 || >= 5.0.3 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native-scripts [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ react-native-scripts > xdl > jsonwebtoken > joi > hoek │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/566 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Moderate │ Prototype pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ hoek │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ > 4.2.0 < 5.0.0 || >= 5.0.3 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native-scripts [dev] │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ react-native-scripts > xdl > jsonwebtoken > joi > topo > │
│ │ hoek │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/566 │
└───────────────┴──────────────────────────────────────────────────────────────┘
┌───────────────┬──────────────────────────────────────────────────────────────┐
│ Low │ Prototype Pollution │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package │ lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Patched in │ >=4.17.5 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ react-native │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path │ react-native > plist > xmlbuilder > lodash │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info │ https://nodesecurity.io/advisories/577 │
When I run npm outdated everything seems to be up to date.
Any help resolving these would be appreciated.
Thanks
Try to run $npm list react-native, it will give you the overview where the package is used and the corresponding versions. My guess will be, those are not everywhere the latest/requiered. Hope this also will help: npm check and update package if needed... The problem is the following: your packages are all up-to-date, but npm install command does not update the versions of these packages in package.json files. To do that you need to use npm-check-updates: How do I update each dependency in package.json to the latest version?

Hadoop Restore from namenode and datanode files

I have the datanode, namenode and secondary namenode folder (with all data or information inside) from a a different hadoop installation.
My question is, how can you see whats in there or add it to your local HDFS to see the data or information.
There can be a way to restore it or something, but i cant find any information about it.
The folder tree is like this:
For Namenode & SecondaryNamenode:
data/dfs/name
├── current
│ ├── VERSION
│ ├── edits_0000000000000000001-0000000000000000007
│ ├── edits_0000000000000000008-0000000000000000015
│ ├── edits_0000000000000000016-0000000000000000022
│ ├── edits_0000000000000000023-0000000000000000029
│ ├── edits_0000000000000000030-0000000000000000030
│ ├── edits_0000000000000000031-0000000000000000031
│ ├── edits_inprogress_0000000000000000032
│ ├── fsimage_0000000000000000030
│ ├── fsimage_0000000000000000030.md5
│ ├── fsimage_0000000000000000031
│ ├── fsimage_0000000000000000031.md5
│ └── seen_txid
And for Datanode:
data/dfs/data/
├── current
│ ├── BP-1079595417-192.168.2.45-1412613236271
│ │ ├── current
│ │ │ ├── VERSION
│ │ │ ├── finalized
│ │ │ │ └── subdir0
│ │ │ │ └── subdir1
│ │ │ │ ├── blk_1073741825
│ │ │ │ └── blk_1073741825_1001.meta
│ │ │ │── lazyPersist
│ │ │ └── rbw
│ │ ├── dncp_block_verification.log.curr
│ │ ├── dncp_block_verification.log.prev
│ │ └── tmp
│ └── VERSION
Thanks in advance.
The standard solution for copying data between different Hadoop clusters is to run the DistCp command to execute a distributed copy of the desired files from source to destination.
Assuming that the other cluster is no longer running, and you only have these backup files, then it's possible to restore by copying the files that you have into the directories used by the new Hadoop cluster. These locations will be specified in configuration properties in hdfs-site.xml: dfs.namenode.name.dir for the NameNode (your data/dfs/name directory) and dfs.datanode.data.dir for the DataNode (your data/dfs/data directory).
Please note that this likely will only work if you run the same version of Hadoop from the prior deployment. Otherwise, there could be a compatibility problem. If you attempt to run an older version, then the NameNode will fail to start. If you attempt to run a newer version, then you may need to go through an upgrade process first by running hdfs namenode -upgrade.
One other option if you just need to look at the file system metadata is to use the Offline Image Viewer and Offline Edits Viewer commands. These commands can decode and browse the fsimage and edits files respectively.

Components and use of Angular modules in Angular 1.5

I am trying to adopt the new .component released in angular 1.5. Although I am having a tough time understanding where modules fit in now.
Before I used to separate my components into angular modules, what relationship does this have now that components are here ?
Just create one angular module and add all components under this, or continue to use angular modules as well as components ?
The documentation doesn't seem to go into this. If I am still using modules then what is the use of components, or if I am using components what is the use of more than 1 module ?
I'm in the same boat here...
Here is what I found. Hope this helps us all
From Angular Docs:
1.Module: You can think of a module as a container for the different parts of your app – controllers, services, filters, directives, etc.
Modules Recomended Setup
"... we recommend that you break your application to multiple modules like this:
A module for each feature
A module for each reusable component (especially directives and filters, Please see below component definition; special kind of directive)
And an application level module
which depends on the above modules and contains any initialization
code.
2.Component:In Angular a Component is a special kind of directive that uses a simpler configuration which is suitable for a component-based application structure.
Advantages of Components:
simpler configuration than plain directives
promote sane defaults and best practices
optimized for component-based architecture
writing component directives will make it easier to upgrade to Angular 2
When not to use Components:
for directives that need to perform actions in compile and pre-link functions, because they aren't available
when you need advanced directive definition options like priority, terminal, multi-element
when you want a directive that is triggered by an attribute or CSS class, rather than an element
So trying to make sense of all this its seems like you need a module to organize or as a top "container" if you will and then add component/subcomponent as required.
angular.module('app',[])
.component('component')
.component('common')
It all comes down to componetize the app:
This image is from angular 2 patterns in angular 1 (highly recommended)
Boottom line: Angular 1's doc is not that clear on the subject but we can see it as a way of organizing modules/components
Modules are always the containers to which
We add components and subcomponents depending on the structure
ToodMottos recomendation on File Structure
"...We should ideally have three high-level modules: root, component and common..."
Here we can see how modules become components and subcomponents
├── app/
│ ├── components/
│ │ ├── calendar/
│ │ │ ├── calendar.module.js
│ │ │ ├── calendar.component.js
│ │ │ ├── calendar.service.js
│ │ │ ├── calendar.spec.js
│ │ │ ├── calendar.html
│ │ │ ├── calendar.scss
│ │ │ └── calendar-grid/
│ │ │ ├── calendar-grid.module.js
│ │ │ ├── calendar-grid.component.js
│ │ │ ├── calendar-grid.directive.js
│ │ │ ├── calendar-grid.filter.js
│ │ │ ├── calendar-grid.spec.js
│ │ │ ├── calendar-grid.html
│ │ │ └── calendar-grid.scss
│ │ ├── events/
│ │ │ ├── events.module.js
│ │ │ ├── events.component.js
│ │ │ ├── events.directive.js
│ │ │ ├── events.service.js
│ │ │ ├── events.spec.js
│ │ │ ├── events.html
│ │ │ ├── events.scss
│ │ │ └── events-signup/
│ │ │ ├── events-signup.module.js
│ │ │ ├── events-signup.component.js
│ │ │ ├── events-signup.service.js
│ │ │ ├── events-signup.spec.js
│ │ │ ├── events-signup.html
│ │ │ └── events-signup.scss
│ │ └── components.module.js
│ ├── common/
│ │ ├── nav/
│ │ │ ├── nav.module.js
│ │ │ ├── nav.component.js
│ │ │ ├── nav.service.js
│ │ │ ├── nav.spec.js
│ │ │ ├── nav.html
│ │ │ └── nav.scss
│ │ ├── footer/
│ │ │ ├── footer.module.js
│ │ │ ├── footer.component.js
│ │ │ ├── footer.service.js
│ │ │ ├── footer.spec.js
│ │ │ ├── footer.html
│ │ │ └── footer.scss
│ │ └── common.module.js
│ ├── app.module.js
│ ├── app.component.js
│ └── app.scss
└── index.html
ToodMottos style Guide: Modular Achitecture (I must Read)
Here is more info on angular Module
Components in Angular 1.5 are special kind of directives which are suitable for component based architecture. They are more like directives on steroids.
Before I used to separate my components into angular modules, what relationship does this have now that components are here ?
Now that the components are there you can separate related components into different modules.
Just create one angular module and add all components under this, or continue to use angular modules as well as components ?
You can use the same pattern you used before to separate out the controllers.
components in angular 1.5 help you create actual components that have their own view and bindings. They were created to allow angular 1.5 devs understand the pattern and migrate easily to Angular 2.0 later.

Meteor's Load Order and Angular Modules

The folder structure of my Angular-Meteor-app looks like this:
.
├── client
│ ├── app
│ │ ├── auth
│ │ │ ├── login
│ │ │ │ ├── login.controller.js
│ │ │ │ ├── login.html
│ │ │ ├── register
│ │ │ │ ├── ...
│ │ │ ├── reset-password
│ │ │ │ ├── ...
│ │ │ ├── route.config.js
│ │ ├── lib
│ │ │ ├── app.module.js
│ │ │ ├── auth.module.js
│ │ ├── ...
│ ├── ...
├── ...
Please note that because of Meteor's load order I cannot put auth.module.js under the auth directory but have to place it under the lib directory. Otherwise Angular would complain that the auth module could not be injected when used in login.controller.js. (Files in subdirectories are loaded before files in parent directories, all files in lib are moved before everything else.)
What I would like is to move auth.module.js in the auth folder, so I have all files of my auth module in the right place:
.
├── client
│ ├── app
│ │ ├── auth
│ │ │ ├── login
│ │ │ │ ├── login.controller.js
│ │ │ │ ├── login.html
│ │ │ ├── register
│ │ │ │ ├── ...
│ │ │ ├── reset-password
│ │ │ │ ├── ...
│ │ │ ├── auth.module.js
│ │ │ ├── route.config.js
│ │ ├── lib
│ │ │ ├── app.module.js
│ │ ├── ...
│ ├── ...
├── ...
Any idea how to manage this?
I think you've got at least two options:
Make client/auth flat, so that the lexicographic ordering will load auth.module.js before login.controller.js.
│ │ ├── auth
│ │ │ ├── auth.module.js
│ │ │ ├── login.controller.js
│ │ │ ├── login.html
│ │ │ ├── ...
Or use yet another lib sub-directory
│ │ ├── auth
│ │ │ ├── lib
| │ │ │ ├── auth.module.js
│ │ │ ├── login
│ │ │ │ ├── login.controller.js
│ │ │ │ ├── login.html
│ │ │ ├── ...
Of course, one could argue that your code should not depend in the load order, i.e., you should only use the auth code once everything is loaded, e.g., in oMeteor.startup or onCreate of templates.

Resources