Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
0ad3fd3
1
Mar 15, 2019
4a67b19
1
Mar 15, 2019
f9bb1b8
chanhes
Mar 16, 2019
10918da
hello
Mar 16, 2019
d5d9bbd
whole end added
Mar 16, 2019
65e7dab
favicon dist
Mar 16, 2019
9db3988
dist
Mar 17, 2019
481be1f
typeerror resolve in userprofile
Mar 17, 2019
498a898
typeerror resolve in userprofile
Mar 17, 2019
7930468
Changes for socket in edit.ts and search service navigation
iamkishlayverma Mar 17, 2019
bb6329f
changes in properties of auth n recommend
achintyapataskar Mar 17, 2019
50b03fc
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
achintyapataskar Mar 17, 2019
966ddd4
chnages for routing
Mar 17, 2019
d69d17b
chnages for routing
Mar 17, 2019
2733457
chnages for routing
Mar 17, 2019
7f9c589
chnages for routing
Mar 17, 2019
9c97ed6
Submission service done
iamkishlayverma Mar 17, 2019
ecfe7b4
logout reroute
Mar 17, 2019
f514c23
logout reroute dist
Mar 17, 2019
7ae0826
logout reroute dist 2
Mar 17, 2019
3aaa92a
Chnages in recommendation getting data using Kafka
iamkishlayverma Mar 18, 2019
94aa96e
Chnages in recommendation for jar version
iamkishlayverma Mar 18, 2019
05a5c31
Chnages in all services for @cross-origin
iamkishlayverma Mar 18, 2019
c346ac0
Changes in the mapping url
iamkishlayverma Mar 18, 2019
307e374
Changes in recommendation
iamkishlayverma Mar 18, 2019
1624897
updated recommend url
Mar 18, 2019
28019b2
Changes in recommendation
iamkishlayverma Mar 18, 2019
3cd7410
submission duplication is removed from userprofile data
Mar 18, 2019
c20fac1
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
Mar 18, 2019
7c2a2ec
Changes for recommendation
iamkishlayverma Mar 18, 2019
09ac8f4
Changes for recommendation
iamkishlayverma Mar 18, 2019
c432d38
Changes for recommendation
iamkishlayverma Mar 18, 2019
1cb3bf0
change in questionServiceImpl
Mar 18, 2019
e3bf015
changed in questionServiceImpl changed tag to lowercase in save
Mar 18, 2019
8045351
Changes for recommendation
iamkishlayverma Mar 18, 2019
eebbb58
Changes for recommendation
iamkishlayverma Mar 18, 2019
8f0edff
changed kafkaLisnerService and removed hard coded data as message
Mar 18, 2019
552fade
changed kafkaLisnerService and removed hard coded data as message
Mar 18, 2019
6235a94
lowercase search
Mar 18, 2019
94b690f
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
Mar 18, 2019
2742f36
lowercase search with dist
Mar 18, 2019
eaf7499
Changes for questions (tags in lower case)
iamkishlayverma Mar 18, 2019
a311278
Changes for recommendations
iamkishlayverma Mar 18, 2019
1334ab7
changed userprofile ts and html and added scorebadgeService call and …
Mar 18, 2019
14a008a
userprofile
Mar 18, 2019
edce1f8
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
Mar 18, 2019
d7db5b3
build frontend code
Mar 18, 2019
44c2e50
build frontend code
Mar 18, 2019
c2884ca
Some arithmatic changes for score calculation
iamkishlayverma Mar 18, 2019
abd3b68
Some arithmatic changes for score calculation
iamkishlayverma Mar 18, 2019
fce2613
Logout and Re-route after delete user
Mar 18, 2019
046338e
Logout and Re-route after delete user 1
Mar 18, 2019
b9e0677
Logout and Re-route after delete user 1 dist
Mar 18, 2019
a778c2b
email verification removed
Mar 18, 2019
08ee976
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
Mar 18, 2019
fca2854
email verification removed
Mar 18, 2019
c70fa70
Updated seed question csv
iamkishlayverma Mar 18, 2019
01dce8a
changed in score-badge-service kafkalisterner
Mar 18, 2019
43f6126
changed in score-badge-service kafkalisterner
Mar 18, 2019
7a52ae1
changed kafkaLister
Mar 18, 2019
482a3b8
Exe, score, userprofile
Mar 18, 2019
f3a82cb
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
Mar 18, 2019
3ff8943
signup alert
Mar 18, 2019
865ac67
signup alert dist
Mar 18, 2019
7620a4e
extra comments removed from frontend
ishumatil Mar 18, 2019
ad4a285
changes done in recommendation
ishumatil Mar 18, 2019
f6f2e62
changes done in recommendation
ishumatil Mar 18, 2019
146791c
changed scorebadge html
Mar 18, 2019
e014119
changed scorebadge html
Mar 18, 2019
227c15c
changed scorebadge html and userprofile
Mar 18, 2019
3de8559
dist creation
iamkishlayverma Mar 18, 2019
5967bfa
dist creation
iamkishlayverma Mar 18, 2019
7b56316
dist creation
iamkishlayverma Mar 18, 2019
540f6b6
dist changes
ishumatil Mar 18, 2019
e68724b
Fixed the parsing error
iamkishlayverma Mar 19, 2019
bbabfd7
sys out added to kafka
Mar 19, 2019
63d4bbc
Merge branch 'v1.0.7' of https://github.com/stackroute/boeing-wave3-m…
Mar 19, 2019
3fab98f
sys out added to kafka
Mar 19, 2019
755c580
sys out added to kafka
Mar 19, 2019
e5f6460
sys out added to kafka
Mar 19, 2019
434fb96
sys out added to kafka
Mar 19, 2019
1fe8e8d
sys out added to kafka
Mar 19, 2019
eb3ff8d
changes in edit
Mar 19, 2019
ed27d9b
changes in edit
Mar 19, 2019
b0817c7
Update UserService.java
Ujjawala Mar 19, 2019
d96a8a0
config-server done
aroranamita09 Mar 19, 2019
d41b9d0
greenwich dependency resolved
aroranamita09 Mar 19, 2019
3ddd323
Added eureka client config
iamkishlayverma Mar 19, 2019
2759a87
Fixed the bootstrap.properties file
iamkishlayverma Mar 19, 2019
5743411
Some changes for submit button in edit.ts
iamkishlayverma Mar 19, 2019
e42f5f4
Chnages for submit button
aroranamita09 Mar 19, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

/node/
node_tmp/
node_modules/
npm-debug.log.*

######################
Expand Down
25 changes: 25 additions & 0 deletions authentication-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/target/
!.mvn/wrapper/maven-wrapper.jar

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/
/build/
6 changes: 6 additions & 0 deletions authentication-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
FROM openjdk:10

ADD ./target/authentication-service-1.0.3-SNAPSHOT.jar authentication-service.jar
EXPOSE 8021

ENTRYPOINT ["java","-jar","authentication-service.jar"]
103 changes: 103 additions & 0 deletions authentication-service/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.stackroute</groupId>
<artifactId>mashup</artifactId>
<version>1.0.3-SNAPSHOT</version>
</parent>
<artifactId>authentication-service</artifactId>
<name>authentication-service</name>
<description>Authentication Service</description>

<properties>
<java.version>10</java.version>
</properties>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>spring-security-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.jsonwebtoken</groupId>
<artifactId>jjwt</artifactId>
<version>0.9.0</version>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
<version>2.6.1</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.6.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.kafka</groupId>
<artifactId>spring-kafka-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.jackson</groupId>
<artifactId>jackson-xc</artifactId>
<version>1.9.11</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
<version>2.0.2.RELEASE</version>
</dependency>


</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>


</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.stackroute;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.web.bind.annotation.CrossOrigin;

@CrossOrigin("*")
@EnableEurekaClient
@SpringBootApplication
public class AuthenticationServiceApplication {

public static void main(String[] args) {

SpringApplication.run(AuthenticationServiceApplication.class, args);
}

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.stackroute.config;

import org.apache.kafka.clients.consumer.ConsumerConfig;
import org.apache.kafka.common.serialization.StringDeserializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.kafka.annotation.EnableKafka;
import org.springframework.kafka.config.ConcurrentKafkaListenerContainerFactory;
import org.springframework.kafka.core.ConsumerFactory;
import org.springframework.kafka.core.DefaultKafkaConsumerFactory;

import java.util.HashMap;
import java.util.Map;

@EnableKafka
@Configuration
public class KafkaConfiguration {
@Bean
public ConsumerFactory<String,String> consumerFactory(){
Map<String,Object> config = new HashMap<>();

config.put(ConsumerConfig.BOOTSTRAP_SERVERS_CONFIG,"localhost:9092");
config.put(ConsumerConfig.GROUP_ID_CONFIG,"group_id_auth");
config.put(ConsumerConfig.KEY_DESERIALIZER_CLASS_CONFIG, StringDeserializer.class);
config.put(ConsumerConfig.VALUE_DESERIALIZER_CLASS_CONFIG,StringDeserializer.class);

return new DefaultKafkaConsumerFactory<>(config);
}

@Bean
public ConcurrentKafkaListenerContainerFactory<String,String> kafkaListenerContainerFactory(){
ConcurrentKafkaListenerContainerFactory<String,String> factory = new ConcurrentKafkaListenerContainerFactory();
factory.setConsumerFactory(consumerFactory());
return factory;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.stackroute.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import springfox.documentation.builders.RequestHandlerSelectors;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;

import static springfox.documentation.builders.PathSelectors.regex;

@Configuration
@EnableSwagger2
public class SwaggerConfig {
@Bean
public Docket productApi() {
return new Docket(DocumentationType.SWAGGER_2)
.select().apis(RequestHandlerSelectors.basePackage("com.stackroute.authenticationservice.controller"))
.paths(regex("/api/auth.*"))
.build();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
package com.stackroute.controller;

import javax.validation.Valid;
import com.stackroute.message.request.LoginForm;
import com.stackroute.message.response.JwtResponse;
import com.stackroute.repository.UserRepository;
import com.stackroute.security.jwt.JwtProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationManager;
import org.springframework.security.authentication.UsernamePasswordAuthenticationToken;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@CrossOrigin("*")
@RestController
@RequestMapping("/api/auth")
public class AuthRestAPIs {

@Autowired
AuthenticationManager authenticationManager;

@Autowired
UserRepository userRepository;

@Autowired
PasswordEncoder encoder;

@Autowired
JwtProvider jwtProvider;

// post mapping class for signin of a user have parameters username and password
@PostMapping("/signin")
public ResponseEntity<?> authenticateUser(@Valid @RequestBody LoginForm loginRequest) {

Authentication authentication = authenticationManager.authenticate(
new UsernamePasswordAuthenticationToken(loginRequest.getUsername(), loginRequest.getPassword()));

SecurityContextHolder.getContext().setAuthentication(authentication);

// generate jwt token string for the user that are logging in
String jwt = jwtProvider.generateJwtToken(authentication);
UserDetails userDetails = (UserDetails) authentication.getPrincipal();

// return jwt token and the username from the user details
return ResponseEntity.ok(new JwtResponse(jwt, userDetails.getUsername(), userDetails.getAuthorities()));
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package com.stackroute.controller;

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = "*", maxAge = 3600)
@RestController
public class TestRestAPIs {

// map the user to the role user during sign in
@GetMapping("/api/test/user")
@PreAuthorize("hasRole('USER')")
public String userAccess() {

return ">>> User Contents!";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.stackroute.message.request;

import javax.validation.constraints.NotBlank;

// setter and getter functions for the username and password to login
public class LoginForm {
@NotBlank
private String username;

@NotBlank
private String password;

public String getUsername() {

return username;
}

public void setUsername(String username) {

this.username = username;
}

public String getPassword() {

return password;
}

public void setPassword(String password) {

this.password = password;
}
}
Loading