-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
2,705 additions
and
11 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,9 @@ | ||
global: CODECOV_TOKEN="2215f466-5f0d-417f-b4f3-ea60ccdb863e" | ||
|
||
language: java | ||
jdk: | ||
- oraclejdk8 | ||
sudo: false | ||
script: mvn clean verify | ||
script: "mvn cobertura:cobertura" | ||
after_success: | ||
- bash <(curl -s https://codecov.io/bash) -t "2215f466-5f0d-417f-b4f3-ea60ccdb863e" | ||
- bash <(curl -s https://codecov.io/bash) | ||
|
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package br.com.app; | ||
|
||
//import com.sun.jersey.core.util.Priority; | ||
//import java.io.IOException; | ||
//import java.util.Calendar; | ||
//import java.util.Map; | ||
//import javax.ws.rs.NotAuthorizedException; | ||
//import javax.ws.rs.Priorities; | ||
//import javax.ws.rs.container.ContainerRequestContext; | ||
//import javax.ws.rs.container.ContainerRequestFilter; | ||
//import javax.ws.rs.core.HttpHeaders; | ||
//import javax.ws.rs.core.Response; | ||
//import javax.ws.rs.ext.Provider; | ||
|
||
/** | ||
* Classe sempre autentifica metodos que possui @Secured | ||
* | ||
* @author Felipe L. Garcia | ||
*/ | ||
//@Secured | ||
//@Provider | ||
//@Priority(Priorities.AUTHENTICATION) | ||
public class AuthenticationFilter {//implements ContainerRequestFilter { | ||
|
||
// @Override | ||
// public void filter(ContainerRequestContext requestContext) throws IOException { | ||
// | ||
// // Get the HTTP Authorization header from the request | ||
// String authorizationHeader = | ||
// requestContext.getHeaderString(HttpHeaders.AUTHORIZATION); | ||
// | ||
// // Check if the HTTP Authorization header is present and formatted correctly | ||
// if (authorizationHeader == null | ||
// || !authorizationHeader.startsWith("token ")) { | ||
// throw new NotAuthorizedException("Authorization header must be provided"); | ||
// } | ||
// | ||
// // Extract the token from the HTTP Authorization header | ||
// String token = authorizationHeader.substring("token ".length()).trim(); | ||
// | ||
// try { | ||
// | ||
// validateToken(token); | ||
// | ||
// } catch (Exception e) { | ||
// requestContext.abortWith( | ||
// Response.status(Response.Status.UNAUTHORIZED).build()); | ||
// } | ||
// } | ||
// | ||
// /** Validar timeCreate+timeExp > NOW*/ | ||
// private void validateToken(String token) throws Exception { | ||
// Map<Token,Long> listToken = PollsService.getListToken(); | ||
// | ||
// for (Map.Entry<Token, Long> entry : listToken.entrySet()) { | ||
// Token tok = entry.getKey(); | ||
// Long timeCreate = entry.getValue(); | ||
// //BUSCAR TOKEN | ||
// if(!tok.getAccess_token().equals(token)){ | ||
// continue; | ||
// } | ||
// | ||
// Calendar calendar = Calendar.getInstance(); | ||
// calendar.setTimeInMillis(timeCreate); | ||
// //DIMINUIR TEMPO DE EXPIRAR TOKEN | ||
// calendar.add(Calendar.MILLISECOND, (int) tok.getExpires_in()); | ||
// //DENTRO DO PRAZO | ||
// if(calendar.getTimeInMillis() > System.currentTimeMillis()){ | ||
// return ; | ||
// } | ||
// } | ||
// throw new Exception("Token inválido"); | ||
// } | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package br.com.app; | ||
/** | ||
* | ||
* @author Felipe L. Garcia | ||
*/ | ||
public class Choice { | ||
|
||
private int choice_id; | ||
private String choice; | ||
private String url; | ||
private int votes; | ||
|
||
public int getChoice_id() { | ||
return choice_id; | ||
} | ||
|
||
public void setChoice_id(int choice_id) { | ||
this.choice_id = choice_id; | ||
} | ||
|
||
public String getChoice() { | ||
return choice; | ||
} | ||
|
||
public void setChoice(String choice) { | ||
this.choice = choice; | ||
} | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
public int getVotes() { | ||
return votes; | ||
} | ||
|
||
public void setVotes(int votes) { | ||
this.votes = votes; | ||
} | ||
|
||
|
||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package br.com.app; | ||
/** | ||
* | ||
* @author Felipe L. Garcia | ||
*/ | ||
public class EntryPoint { | ||
private String url; | ||
|
||
public String getUrl() { | ||
return url; | ||
} | ||
|
||
public void setUrl(String url) { | ||
this.url = url; | ||
} | ||
|
||
} |
Oops, something went wrong.