All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
- engage
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.ByteArrayOutputStream; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.util.zip.GZIPInputStream; | |
import java.util.zip.GZIPOutputStream; | |
public class Gzip { |
package examples; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.boot.autoconfigure.SpringBootApplication; | |
@SpringBootApplication | |
@EnableAutoConfiguration | |
public class GatewayApplication { |
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
import javax.xml.transform.*; | |
import javax.xml.transform.stream.StreamResult; | |
import javax.xml.transform.stream.StreamSource; | |
import java.io.File; | |
import java.io.IOException; | |
import java.net.URISyntaxException; | |
public class XsltTransform { | |
public static void main(String[] args) throws IOException, | |
URISyntaxException, |
package cz.monetplus.mac; | |
import static org.assertj.core.api.Assertions.assertThat; | |
import org.apache.commons.codec.binary.Hex; | |
import org.bouncycastle.crypto.BlockCipher; | |
import org.bouncycastle.crypto.Mac; | |
import org.bouncycastle.crypto.engines.DESEngine; | |
import org.bouncycastle.crypto.macs.ISO9797Alg3Mac; | |
import org.bouncycastle.crypto.params.KeyParameter; |
@Configuration | |
@EnableWebMvcSecurity | |
public class WebSecurityConfig | |
extends WebSecurityConfigurerAdapter { | |
@Value("${oauth.check_token.url:http://localhost:3030/oauth/token/info}") | |
private String checkTokenUrl; | |
@Autowired @Qualifier("restTemplate") | |
private RestOperations authRestTemplate; |
@Configuration | |
@EnableWebMvcSecurity | |
public class WebSecurityConfig | |
extends WebSecurityConfigurerAdapter { | |
@Value("${oauth.check_token.url:http://localhost:3030/oauth/token/info}") | |
private String checkTokenUrl; | |
@Autowired @Qualifier("restTemplate") | |
private RestOperations authRestTemplate; |
http.addFilterBefore(customAuthFilter(), SecurityContextPersistenceFilter.class) | |
.authorizeRequests() | |
.antMatchers("/**") | |
.authenticated() | |
.and() | |
.exceptionHandling().disable() | |
.sessionManagement().disable() | |
.rememberMe().disable() | |
.x509().disable() | |
.headers().disable() |
// MyFilter.java | |
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { | |
OutputStream out = response.getOutputStream(); | |
ResponseWrapper wrapper = new ResponseWrapper((HttpServletResponse)response); | |
chain.doFilter(request, wrapper); | |
byte responseContent[] = wrapper.getData(); | |
// Write copied response, should change whatever you want in 'responseContent' before sending to client | |
out.write(responseContent); |
How to Create Your YouTube API Credentials | |
https://vidible.zendesk.com/hc/en-us/articles/207036056-How-to-Create-Your-YouTube-API-Credentials | |
Creating your YouTube API Credentials is accomplished by performing to main stages: | |
Stage I - Creating a Google OAuth 2.0 Web application client. | |
Stage II - Creating a YouTube refresh token. | |