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 {
118118func (f * faradaySubServer ) Permissions () map [string ][]bakery.Op {
119119 return perms .RequiredPermissions
120120}
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 {
5858 // Permissions returns a map of all RPC methods and their required
5959 // macaroon permissions to access the sub-server.
6060 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 {}
6165}
Original file line number Diff line number Diff line change @@ -128,3 +128,11 @@ func (l *loopSubServer) MacPath() string {
128128func (l * loopSubServer ) Permissions () map [string ][]bakery.Op {
129129 return perms .RequiredPermissions
130130}
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 {
118118func (p * poolSubServer ) Permissions () map [string ][]bakery.Op {
119119 return perms .RequiredPermissions
120120}
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 {
174174func (t * taprootAssetsSubServer ) Permissions () map [string ][]bakery.Op {
175175 return perms .RequiredPermissions
176176}
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