Skip to content

Commit 88055c1

Browse files
author
marcinromaszewicz
committed
Create an authenticated API example
This change creates a little program which shows how to perform JWT validation.
1 parent a870716 commit 88055c1

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

request_helpers.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,11 @@ func (r *RequestBuilder) WithHeader(header, value string) *RequestBuilder {
8585
return r
8686
}
8787

88+
func (r *RequestBuilder) WithJWSAuth(jws string) *RequestBuilder {
89+
r.Headers["Authorization"] = "Bearer " + jws
90+
return r
91+
}
92+
8893
func (r *RequestBuilder) WithHost(value string) *RequestBuilder {
8994
return r.WithHeader("Host", value)
9095
}

0 commit comments

Comments
 (0)