-
-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* embed keygen form * Added additional tests * Updated generation responses, fixed router subscription * added html template
- Loading branch information
Showing
11 changed files
with
709 additions
and
31 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 |
---|---|---|
|
@@ -16,7 +16,6 @@ | |
debug | ||
*.log | ||
*.sst | ||
*.html | ||
build/* | ||
*.log | ||
*.bat | ||
|
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,54 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" crossorigin="anonymous"> | ||
<style> | ||
pre { border: none; padding: 5px; background-color: transparent} | ||
.string { color: #d35400; } | ||
.number { color: #8e44ad; } | ||
.boolean { color: #27ae60; } | ||
.null { color: #c0392b; } | ||
.key { color: #2980b9; } | ||
</style> | ||
</head> | ||
<body> | ||
<div class="container" id="content"> | ||
<div class="row"> | ||
<form method="post"> | ||
<div class="col-md-offset-2 col-md-8"> | ||
<h3>Key Generation</h3> | ||
<div class="well"> | ||
<div class="form-group"> | ||
<label for="keygenKey">Secret Key</label> | ||
<input type="text" class="form-control" name="key" value="{{.Key}}" required="true" placeholder="[Required] Your secret key"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="keygenChannel">Target Channel</label> | ||
<input type="text" class="form-control" name="channel" value="{{.Channel}}" required="true" placeholder="[Required] The target channel to secure with the key"> | ||
</div> | ||
<div class="form-group"> | ||
<label for="keygenTtl">Time-To-Live</label> | ||
<input type="number" class="form-control" name="ttl" value={{.TTL}} placeholder="Number of seconds after which the key will expire"> | ||
</div> | ||
<div class="form-group"> | ||
<label>Security Access</label> | ||
<div class="checkbox"><label><input name="sub" {{ isChecked .Sub }} type="checkbox"> Allow <b>read</b> (subscribe) from the channel</label></div> | ||
<div class="checkbox"><label><input name="pub" {{ isChecked .Pub }} type="checkbox"> Allow <b>write</b> (publish) to the channel</label></div> | ||
<div class="checkbox"><label><input name="store" {{ isChecked .Store }} type="checkbox"> Allow <b>store</b> messages into the channel store</label></div> | ||
<div class="checkbox"><label><input name="load" {{ isChecked .Load }} type="checkbox"> Allow <b>load</b> messages from the channel store</label></div> | ||
<div class="checkbox"><label><input name="presence" {{ isChecked .Presence }} type="checkbox"> Allow <b>presence</b> querying </label></div> | ||
<div class="checkbox"><label><input name="extend" {{ isChecked .Extend }} type="checkbox"> Allow <b>extending</b> for private sub-channels</label></div> | ||
</div> | ||
|
||
<div class="form-group"> | ||
<button id="keygen" type="submit" class="btn btn-default">Generate Key</button> | ||
</div> | ||
<pre id="keygenResponse">{{.Response}}</pre> | ||
</div> | ||
</div> | ||
|
||
</form> | ||
</div> | ||
</div> | ||
</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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// +build ignore | ||
|
||
package main | ||
|
||
import ( | ||
"log" | ||
"net/http" | ||
|
||
"github.com/shurcooL/vfsgen" | ||
) | ||
|
||
func main() { | ||
|
||
var fs http.FileSystem = http.Dir("./internal/broker/assets") | ||
|
||
err := vfsgen.Generate(fs, vfsgen.Options{ | ||
Filename: "./internal/broker/assets.go", | ||
PackageName: "broker", | ||
}) | ||
if err != nil { | ||
log.Fatalln(err) | ||
} | ||
} |
Oops, something went wrong.