[WIP] Fix ui api authentication
This commit is contained in:
@@ -132,8 +132,7 @@ func authenticateAPIRequest(ctx context.Context, pktInfo *packet.Info) (retry bo
|
||||
var originalPid int
|
||||
|
||||
// Get authenticated path.
|
||||
// FIXME(vladimir): provide a better check for detecting filepath. Note there is exception on linux with portmaster ui.
|
||||
authenticatedPath := "" // updates.RootPath()
|
||||
authenticatedPath := module.instance.BinaryUpdates().GetRootPath()
|
||||
if authenticatedPath == "" {
|
||||
return false, fmt.Errorf(deniedMsgMisconfigured, api.ErrAPIAccessDeniedMessage) //nolint:stylecheck // message for user
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import (
|
||||
"github.com/safing/portmaster/service/netquery"
|
||||
"github.com/safing/portmaster/service/network"
|
||||
"github.com/safing/portmaster/service/profile"
|
||||
"github.com/safing/portmaster/service/updates"
|
||||
"github.com/safing/portmaster/spn/access"
|
||||
"github.com/safing/portmaster/spn/captain"
|
||||
)
|
||||
@@ -160,6 +161,7 @@ func New(instance instance) (*Firewall, error) {
|
||||
|
||||
type instance interface {
|
||||
Config() *config.Config
|
||||
BinaryUpdates() *updates.Updates
|
||||
Profile() *profile.ProfileModule
|
||||
Captain() *captain.Captain
|
||||
Access() *access.Access
|
||||
|
||||
Reference in New Issue
Block a user