webhook: sourcehut_builds: ask for access_token instead of authorization_header
This commit is contained in:
parent
3155e21cbb
commit
36f05e6f4e
6 changed files with 37 additions and 24 deletions
|
@ -361,6 +361,15 @@ func (w Webhook) HeaderAuthorization() (string, error) {
|
|||
return secret.DecryptSecret(setting.SecretKey, w.HeaderAuthorizationEncrypted)
|
||||
}
|
||||
|
||||
// HeaderAuthorizationTrimPrefix returns the decrypted Authorization with a specified prefix trimmed.
|
||||
func (w Webhook) HeaderAuthorizationTrimPrefix(prefix string) (string, error) {
|
||||
s, err := w.HeaderAuthorization()
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
return strings.TrimPrefix(s, prefix), nil
|
||||
}
|
||||
|
||||
// SetHeaderAuthorization encrypts and sets the Authorization header.
|
||||
func (w *Webhook) SetHeaderAuthorization(cleartext string) error {
|
||||
if cleartext == "" {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue