[#92] Add detection for write-disabled instances

to deactivate secret creation for non-logged-in users

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2023-06-15 18:49:10 +02:00
parent f5aebbb99a
commit 805a005ed5
No known key found for this signature in database
GPG key ID: D91C3E91E4CAD6F5
14 changed files with 108 additions and 1 deletions

1
api.go
View file

@ -36,6 +36,7 @@ func newAPI(s storage) *apiServer {
func (a apiServer) Register(r *mux.Router) {
r.HandleFunc("/create", a.handleCreate)
r.HandleFunc("/get/{id}", a.handleRead)
r.HandleFunc("/isWritable", func(w http.ResponseWriter, _ *http.Request) { w.WriteHeader(http.StatusNoContent) })
}
func (a apiServer) handleCreate(res http.ResponseWriter, r *http.Request) {