Class: AtprotoAuth::ServerMetadata::ResourceServer
- Inherits:
-
Object
- Object
- AtprotoAuth::ServerMetadata::ResourceServer
- Defined in:
- lib/atproto_auth/server_metadata/resource_server.rb
Overview
This class represents a Resource Server (PDS) and is responsible for validating and managing its metadata. It ensures that the authorization server URLs provided are valid and compliant with expected standards. The class also includes functionality to fetch and parse metadata from a remote URL, raising specific errors for invalid or malformed metadata.
Instance Attribute Summary collapse
-
#authorization_servers ⇒ Object
readonly
Returns the value of attribute authorization_servers.
Class Method Summary collapse
-
.from_url(url) ⇒ ResourceServer
Fetches and validates Resource Server metadata from a URL.
Instance Method Summary collapse
-
#initialize(metadata) ⇒ ResourceServer
constructor
A new instance of ResourceServer.
Constructor Details
#initialize(metadata) ⇒ ResourceServer
Returns a new instance of ResourceServer.
13 14 15 |
# File 'lib/atproto_auth/server_metadata/resource_server.rb', line 13 def initialize() @authorization_servers = (["authorization_servers"]) end |
Instance Attribute Details
#authorization_servers ⇒ Object (readonly)
Returns the value of attribute authorization_servers.
11 12 13 |
# File 'lib/atproto_auth/server_metadata/resource_server.rb', line 11 def @authorization_servers end |
Class Method Details
.from_url(url) ⇒ ResourceServer
Fetches and validates Resource Server metadata from a URL
21 22 23 24 |
# File 'lib/atproto_auth/server_metadata/resource_server.rb', line 21 def self.from_url(url) response = (url) new((response[:body])) end |