mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-16 21:36:21 +00:00
feat: no vamos a expedir tokens efímeros por ahora
This commit is contained in:
parent
8006bd0353
commit
b28d794646
1 changed files with 1 additions and 30 deletions
|
@ -59,40 +59,11 @@ class DeployDistributedPress < Deploy
|
|||
@publisher ||= DistributedPressPublisher.first
|
||||
end
|
||||
|
||||
# El cliente de autenticación se encarga de intercambiar un token por
|
||||
# otro
|
||||
#
|
||||
# @return [DistributedPress::V1::Client::Auth]
|
||||
def auth_client
|
||||
DistributedPress::V1::Client::Auth.new(publisher.client)
|
||||
end
|
||||
|
||||
# Genera un token con permisos de publicación
|
||||
#
|
||||
# @return [DistributedPress::V1::Schemas::NewTokenPayload]
|
||||
def publishing_token_payload
|
||||
DistributedPress::V1::Schemas::NewTokenPayload.new.call(capabilities: %w[publisher])
|
||||
end
|
||||
|
||||
# Genera un token efímero para publicar el sitio
|
||||
#
|
||||
# @return [DistributedPress::V1::Token]
|
||||
def publishing_token
|
||||
auth_client.exchange(publishing_token_payload)
|
||||
end
|
||||
|
||||
# Genera un cliente para publicar el sitio
|
||||
#
|
||||
# @return [DistributedPress::V1::Client]
|
||||
def publishing_client
|
||||
DistributedPress::V1::Client.new(url: publisher.instance, token: publishing_token)
|
||||
end
|
||||
|
||||
# El cliente para actualizar el sitio
|
||||
#
|
||||
# @return [DistributedPress::V1::Client::Site]
|
||||
def site_client
|
||||
DistributedPress::V1::Client::Site.new(publishing_client)
|
||||
DistributedPress::V1::Client::Site.new(publisher.client)
|
||||
end
|
||||
|
||||
# Genera el esquema de datos para poder publicar el sitio
|
||||
|
|
Loading…
Reference in a new issue