mirror of
https://github.com/nirvana-7777/script.service.ultimate.git
synced 2026-10-03 06:22:23 +02:00
Add discovery
This commit is contained in:
@@ -9,7 +9,7 @@ from dataclasses import dataclass, field
|
||||
from typing import Any, Dict, Optional
|
||||
|
||||
from ...base.auth.base_auth import BaseAuthenticator, BaseAuthToken, TokenAuthLevel
|
||||
from ...base.auth.credentials import ClientCredentials, UserPasswordCredentials
|
||||
from ...base.auth.credentials import BaseCredentials, UserPasswordCredentials
|
||||
from ...base.models.proxy_models import ProxyConfig
|
||||
from ...base.utils.logger import logger
|
||||
|
||||
@@ -31,7 +31,7 @@ from .exceptions import (
|
||||
|
||||
|
||||
@dataclass
|
||||
class DiscoveryAnonymousCredentials(ClientCredentials):
|
||||
class DiscoveryAnonymousCredentials(BaseCredentials):
|
||||
"""Discovery+ anonymous credentials"""
|
||||
|
||||
realm: str = DEFAULT_REALM
|
||||
@@ -44,6 +44,13 @@ class DiscoveryAnonymousCredentials(ClientCredentials):
|
||||
def credential_type(self) -> str:
|
||||
return "discovery_anonymous"
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Convert to dictionary for storage"""
|
||||
return {
|
||||
"type": self.credential_type,
|
||||
"realm": self.realm,
|
||||
}
|
||||
|
||||
|
||||
@dataclass
|
||||
class DiscoveryUserCredentials(UserPasswordCredentials):
|
||||
|
||||
Reference in New Issue
Block a user