Skip to content

Commit

Permalink
Display ACL
Browse files Browse the repository at this point in the history
  • Loading branch information
Richard Patel committed Jul 30, 2023
1 parent 37d6327 commit 6192e6f
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 1 deletion.
2 changes: 1 addition & 1 deletion srepanel/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GO?=go
GO_SOURCES:=$(shell find . -name '*.go')
GO_SOURCES:=$(shell find . -type f -not -path './srepanel')

.PHONY: build
build: srepanel
Expand Down
6 changes: 6 additions & 0 deletions srepanel/ghidra/aclmon.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,12 @@ type ACLMon struct {
// Returns reason for context termination as error.
// TODO upgrade to react to inotify events.
func (a *ACLMon) Run(ctx context.Context) error {
acls, err := a.updateACLs()
if err != nil {
log.Printf("First ACL update failed: %v", err)
}
a.ACLs.Store(acls)

ticker := time.NewTicker(30 * time.Second)
defer ticker.Stop()
for {
Expand Down
17 changes: 17 additions & 0 deletions srepanel/web/templates/home.gohtml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@
{{ template "nav.gohtml" . }}
<main class="container">
<h1>Hi, {{ .Identity.Username }}!</h1>
<div class="grid">
<article>
<header>
<strong>Review Access</strong>
</header>
{{ if .ACL | len }}
<ul>
{{ range $repo := .ACL }}
<li>{{ $repo.Repo }}: {{ $repo.Perm }}</li>
{{ end }}
</ul>
{{ else }}
<p>Your account does not have any access to Ghidra repositories.</p>
<p><strong><a href="mailto:richard@mkw.re">Request Access</a></strong></p>
{{ end }}
</article>
<article>
<header>
<strong>Update Ghidra Credentials</strong>
Expand Down Expand Up @@ -60,6 +76,7 @@
<p><mark>Your account does not have a Ghidra password. Please set one!</mark></p>
{{ end }}
</article>
</div>
</main>
{{ template "footer.gohtml" . }}
</body>
Expand Down

0 comments on commit 6192e6f

Please sign in to comment.