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 playwright import async_playwright | |
| from sanic import Sanic | |
| from sanic import response | |
| app = Sanic(name='Translate application') | |
| #test with: curl 'http://localhost:5000/translate?sl=nl&tl=en&translate=auto' | |
| @app.route("/translate") | |
| async def doTranslate(request): |
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 nl.amis.smeetsm.sb; | |
| import oracle.jdbc.OracleArray; | |
| import oracle.jdbc.OracleCallableStatement; | |
| import oracle.jdbc.OracleConnection; | |
| import oracle.jdbc.OracleStruct; | |
| import org.springframework.beans.factory.annotation.Autowired; | |
| import org.springframework.http.HttpHeaders; | |
| import org.springframework.http.ResponseEntity; | |
| import org.springframework.web.bind.annotation.RequestMapping; |
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
| {"kid":"oauth2keypair","alg":"RS256"} |
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
| process_names: | |
| # comm is the second field of /proc/<pid>/stat minus parens. | |
| # It is the base executable name, truncated at 15 chars. | |
| # It cannot be modified by the program, unlike exe. | |
| - comm: | |
| - java | |
| cmdline: | |
| - app.jar |
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
| version: '2' | |
| services: | |
| spring-boot-jdk: | |
| image: "spring-boot-jdk" | |
| container_name: spring-boot-jdk | |
| ports: | |
| - "8080:8080" | |
| networks: | |
| - dockernet | |
| mem_limit: 1024M |
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
| String output = String.format("{ \"access_token\" : \"%s\",\n" + " \"scope\" : \"read write\",\n" + " \"token_type\" : \"Bearer\",\n" + " \"expires_in\" : %s\n}", token,expirytime); |
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
| SignedJWT signedJWT = new SignedJWT(new JWSHeader.Builder(JWSAlgorithm.RS256).keyID(rsaJWK.getKeyID()).build(), claimsSet); | |
| signedJWT.sign(signer); | |
| String token = signedJWT.serialize(); |
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
| JWTClaimsSet claimsSet = new JWTClaimsSet.Builder() | |
| .subject(user) | |
| .issuer(prop.getProperty("tokenissuer")) | |
| .expirationTime(expires) | |
| .issueTime(new Date(new Date().getTime())) | |
| .build(); |
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
| JWSSigner signer = new RSASSASigner(rsaJWK); |
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
| RSAKey rsaJWK = new RSAKey.Builder(myPublicKey).privateKey(myPrivateKey).keyID(prop.getProperty("keyalias")).build(); |
NewerOlder