This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eureka.zuul.security; | |
| import java.io.IOException; | |
| import java.util.List; | |
| import java.util.stream.Collectors; | |
| import javax.servlet.FilterChain; | |
| import javax.servlet.ServletException; | |
| import javax.servlet.http.HttpServletRequest; | |
| import javax.servlet.http.HttpServletResponse; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.eureka.zuul.security; | |
| import javax.servlet.http.HttpServletResponse; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.context.annotation.Bean; | |
| import org.springframework.http.HttpMethod; | |
| import org.springframework.security.config.annotation.web.builders.HttpSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; | |
| import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RunWith(Parameterized.class) | |
| public class CalculatorTest { | |
| @Parameters(name = "{index}: CalculatorTest({0})={1}, throws {2}") | |
| public static Collection<Object[]> data() { | |
| return Arrays.asList(new Object[][]{ | |
| {"1 + 1", 2, null}, | |
| {"1 + 1 + 1", 3, null}, | |
| {"1–1", 0, null}, | |
| {"1 * 1", 1, null}, | |
| {"1 / 1", 1, null}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @RunWith(SpringRunner.class) | |
| @SpringBootTest | |
| public class DemoApplicationTests { | |
| @Autowired | |
| ApplicationContext ac; | |
| @Test | |
| public void contextLoads() { | |
| Calculator calculator = ac.getBean(Calculator.class); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <plugin> | |
| <groupId>org.jacoco</groupId> | |
| <artifactId>jacoco-maven-plugin</artifactId> | |
| <version>0.8.2</version> | |
| <executions> | |
| <execution> | |
| <goals> | |
| <goal>prepare-agent</goal> | |
| </goals> | |
| </execution> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <reporting> | |
| <plugins> | |
| <plugin> | |
| <groupId>org.jacoco</groupId> | |
| <artifactId>jacoco-maven-plugin</artifactId> | |
| <reportSets> | |
| <reportSet> | |
| <reports> | |
| <!-- select non-aggregate reports --> | |
| <report>report</report> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| digraph architecture { | |
| rankdir=LR; | |
| // Storage - #303F9F (dark blue) | |
| node[fillcolor="#303F9F" style="filled" fontcolor="white"]; | |
| database[label="DB"]; cache[label="Redis"]; | |
| // Client-side Apps - #FFEB3B (yellow) | |
| node[fillcolor="#FFEB3B" style="filled" fontcolor="black"]; | |
| front_end[label="Front-end App"]; extension[label="Browser Extension"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Migrating to another remote repo | |
| cd <local_repo> | |
| git remote set-url origin <remote> | |
| git push -u origin master | |
| git push --all | |
| git push --tags |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # generate a keypair on the (Jenkins) machine you’re sending files *from*, then add the resulting public key (id_rsa.pub for example) | |
| # into the .ssh/authorized_keys file of the user that’s receiving the files on your remote machines. | |
| # in the publish over ssh config, you’ll enter the path to your private key on your jenkins host, not the remote hosts. if your Jenkins | |
| # user doesn’t have a keypair, you can generate one using ‘ssh-keygen’ command and be sure to _not_ enter in a passphrase. | |
| # when your job execs, SSH will use this path to your private key (for ex, /var/lib/jenkins/.ssh/id_rsa) when negotiating with the remote | |
| # host and it will match it against the remote host’s .ssh/authorized_keys file entry that you made. | |
| cat id_rsa.pub | (ssh administrator@vzylvmmsapp4 "cat >> .ssh/authorized_keys") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| FROM openjdk:8-jdk-alpine | |
| VOLUME /tmp | |
| MAINTAINER Denis Rosa <denis.rosa@couchbase.com> | |
| ARG JAR_FILE | |
| ADD ${JAR_FILE} app.jar | |
| ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"] |