Working on blog stuff

This commit is contained in:
Caleb Gardner
2024-06-17 07:28:33 -05:00
parent 7b15aab7ec
commit fdd8d49055
8 changed files with 388 additions and 7 deletions
+2
View File
@@ -80,6 +80,8 @@ func (b *Backend) ParseHeader(r *http.Request) (*ParsedHeader, error) {
// If the check if failed, ReturnError will be called and the returned *ParsedHeader will be nil.
// If token is present but invalid, no error will be returned just ParsedHeader.User will be nil.
// The error return will only be populated on "internal" errors and should *probably* be logged.
//
// This function does not check the Key's appID so after calling VerifyHeader it's recommended to check the Key's appID.
func (b *Backend) VerifyHeader(w http.ResponseWriter, r *http.Request, keyPerm string, allowManagementKey bool) (*ParsedHeader, error) {
hdr, err := b.ParseHeader(r)
if hdr == nil || hdr.Key == nil {