We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c6e69bb commit c281025Copy full SHA for c281025
src/utils/auth.jl
@@ -4,10 +4,16 @@
4
5
abstract type Authorization end
6
7
+# TODO: SecureString on 0.7
8
struct OAuth2 <: Authorization
9
token::String
10
end
11
12
+struct UsernamePassAuth <: Authorization
13
+ username::String
14
+ password::String
15
+end
16
+
17
struct AnonymousAuth <: Authorization end
18
19
struct JWTAuth <: Authorization
@@ -68,6 +74,10 @@ function authenticate_headers!(headers, auth::JWTAuth)
68
74
return headers
69
75
70
76
77
+function authenticate_headers!(headers, auth::UsernamePassAuth)
78
+ headers["Authorization"] = "Basic $(base64encode(string(auth.username, ':', auth.password)))"
79
+ return headers
80
71
81
72
82
###################
73
83
# Pretty Printing #
0 commit comments