File tree Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Expand file tree Collapse file tree 5 files changed +44
-0
lines changed Original file line number Diff line number Diff line change @@ -118,3 +118,11 @@ func (f *faradaySubServer) MacPath() string {
118
118
func (f * faradaySubServer ) Permissions () map [string ][]bakery.Op {
119
119
return perms .RequiredPermissions
120
120
}
121
+
122
+ // WhiteListedURLs returns a map of all the sub-server's URLs that can be
123
+ // accessed without a macaroon.
124
+ //
125
+ // NOTE: this is part of the SubServer interface.
126
+ func (f * faradaySubServer ) WhiteListedURLs () map [string ]struct {} {
127
+ return nil
128
+ }
Original file line number Diff line number Diff line change @@ -58,4 +58,8 @@ type SubServer interface {
58
58
// Permissions returns a map of all RPC methods and their required
59
59
// macaroon permissions to access the sub-server.
60
60
Permissions () map [string ][]bakery.Op
61
+
62
+ // WhiteListedURLs returns a map of all the sub-server's URLs that can
63
+ // be accessed without a macaroon.
64
+ WhiteListedURLs () map [string ]struct {}
61
65
}
Original file line number Diff line number Diff line change @@ -128,3 +128,11 @@ func (l *loopSubServer) MacPath() string {
128
128
func (l * loopSubServer ) Permissions () map [string ][]bakery.Op {
129
129
return perms .RequiredPermissions
130
130
}
131
+
132
+ // WhiteListedURLs returns a map of all the sub-server's URLs that can be
133
+ // accessed without a macaroon.
134
+ //
135
+ // NOTE: this is part of the SubServer interface.
136
+ func (l * loopSubServer ) WhiteListedURLs () map [string ]struct {} {
137
+ return nil
138
+ }
Original file line number Diff line number Diff line change @@ -118,3 +118,11 @@ func (p *poolSubServer) MacPath() string {
118
118
func (p * poolSubServer ) Permissions () map [string ][]bakery.Op {
119
119
return perms .RequiredPermissions
120
120
}
121
+
122
+ // WhiteListedURLs returns a map of all the sub-server's URLs that can be
123
+ // accessed without a macaroon.
124
+ //
125
+ // NOTE: this is part of the SubServer interface.
126
+ func (p * poolSubServer ) WhiteListedURLs () map [string ]struct {} {
127
+ return nil
128
+ }
Original file line number Diff line number Diff line change @@ -174,3 +174,19 @@ func (t *taprootAssetsSubServer) MacPath() string {
174
174
func (t * taprootAssetsSubServer ) Permissions () map [string ][]bakery.Op {
175
175
return perms .RequiredPermissions
176
176
}
177
+
178
+ // WhiteListedURLs returns a map of all the sub-server's URLs that can be
179
+ // accessed without a macaroon.
180
+ //
181
+ // NOTE: this is part of the SubServer interface.
182
+ func (t * taprootAssetsSubServer ) WhiteListedURLs () map [string ]struct {} {
183
+ // If the taproot-asset daemon is running in integrated mode, then we
184
+ // use cfg.RpcConf.AllowPublicStats to determine if the public stats
185
+ // endpoints should be included in the whitelist. If it is running in
186
+ // remote mode, however, then we don't know if the public stats are
187
+ // allowed, and so we just allow the request through since the remote
188
+ // daemon will handle blocking the call if it is not whitelisted there.
189
+ return perms .MacaroonWhitelist (
190
+ t .cfg .RpcConf .AllowPublicStats || t .remote ,
191
+ )
192
+ }
You can’t perform that action at this time.
0 commit comments