-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from APSN4/feature/password
feature: encrypt code snippets with a password
- Loading branch information
Showing
12 changed files
with
201 additions
and
10 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 |
---|---|---|
|
@@ -37,4 +37,7 @@ out/ | |
.vscode/ | ||
|
||
### H2 Database ### | ||
*.db | ||
*.db | ||
|
||
### macOS files ### | ||
.DS_Store |
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
35 changes: 35 additions & 0 deletions
35
src/main/java/codes/sharing/sharingcodes/dto/PasswordDTO.java
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,35 @@ | ||
package codes.sharing.sharingcodes.dto; | ||
|
||
public class PasswordDTO { | ||
|
||
public PasswordDTO(String password, String id) { | ||
this.password = password; | ||
this.id = id; | ||
} | ||
|
||
public PasswordDTO(String password) { | ||
this.password = password; | ||
} | ||
public PasswordDTO() { | ||
this.password = ""; | ||
} | ||
|
||
private String password; | ||
private String id; | ||
|
||
public String getPassword() { | ||
return password; | ||
} | ||
|
||
public void setPassword(String password) { | ||
this.password = password; | ||
} | ||
|
||
public String getId() { | ||
return id; | ||
} | ||
|
||
public void setId(String id) { | ||
this.id = id; | ||
} | ||
} |
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
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
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,67 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
|
||
<head> | ||
<meta charset="UTF-8"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<meta name="page-status" content="unavailable"/> | ||
<link rel="stylesheet" href="/css/bootstrap.min.css"> | ||
<link rel="stylesheet" href="/css/styles.css"> | ||
<script src="https://kit.fontawesome.com/224143ea2d.js" crossorigin="anonymous"></script> | ||
<script src="/js/myScript.js"></script> | ||
<title>Secret code snippet!</title> | ||
<link rel="icon" type="image/png" href="/imgs/code-pngrepo-com.png"> | ||
</head> | ||
|
||
<body> | ||
<nav class="navbar navbar-expand-lg navbar-light bg-light"> | ||
<a class="navbar-brand" href="/">Sharing <img src="/imgs/code-pngrepo-com.png" alt="" style="height: 1em;"> Codes</a> | ||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNavAltMarkup" aria-controls="navbarNavAltMarkup" aria-expanded="false" aria-label="Toggle navigation"> | ||
<span class="navbar-toggler-icon"></span> | ||
</button> | ||
<div class="collapse navbar-collapse" id="navbarNavAltMarkup"> | ||
<ul class="navbar-nav mr-auto"> | ||
<li><a class="nav-link" href="/code/latest">Recent codes</a></li> | ||
<li><a class="nav-link" href="/code/usage">Usage</a></li> | ||
<li><a class="nav-link" href="/code/about">About</a></li> | ||
</ul> | ||
<span class="navbar-text"> | ||
<a href="https://github.com/nuromirzak/sharing-codes" target="_blank"> | ||
<i class="fa-brands fa-github fa-2xl" style="color: black"></i> | ||
</a> | ||
</span> | ||
</div> | ||
</nav> | ||
|
||
<div class="container p-3"> | ||
<form action="" onsubmit="check()"> | ||
<div class="form-group"> | ||
<label for="code_snippet"><h1>Secret code snippet 😎</h1></label> | ||
<div class="d-flex justify-content-center"> | ||
<div class="row"> | ||
<div class="col"> | ||
<label for="password_field">Enter your password:</label> | ||
<div class="d-flex justify-content-center"> | ||
<input type="text" class="form-control" id="password_field" placeholder="Secret password" style="margin-right: 10px;"> | ||
<button id="open_snippet" type="submit" class="btn btn-primary">Submit</button> | ||
</div> | ||
<small class="form-text text-muted">This code snippet has been encrypted. You must enter your password to view this code.</small> | ||
<div class="alert alert-danger danger-message" role="alert" style="display: none;"> | ||
<h4 class="alert-heading">Oops!...</h4> | ||
<p></p> | ||
<p>Please check that you have entered the correct data.</p> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</form> | ||
</div> | ||
|
||
|
||
<script src="/js/jquery.slim.min.js"></script> | ||
<script src="/js/bootstrap.bundle.min.js"></script> | ||
</body> | ||
|
||
</html> |
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