libp2p/autotls/acme/api

Search:
Group by:
Source   Edit  

Types

ACMEApi = ref object of RootObj
  acmeServerURL*: Uri
Source   Edit  
ACMEAuthorizationsResponse = object
  challenges*: seq[ACMEChallenge]
Source   Edit  
ACMECertificate = object
  rawCertificate*: string
  certificateExpiry*: DateTime
  certKeyPair*: RsaPrivateKey
Source   Edit  
ACMECertificateResponse = object
  rawCertificate*: string
  certificateExpiry*: DateTime
Source   Edit  
ACMEChallenge = object
  url*: string
  status*: ACMEChallengeStatus
  token*: ACMEChallengeToken
Source   Edit  
ACMEChallengeDns01Response = object
  finalize*: string
  order*: string
  dns01*: ACMEChallenge
Source   Edit  
ACMEChallengeResponse = object
  status*: ACMEOrderStatus
  authorizations*: seq[Authorization]
  finalize*: string
  order*: string
Source   Edit  
ACMEChallengeStatus {.pure.} = enum
  PENDING = "pending", PROCESSING = "processing", VALID = "valid",
  INVALID = "invalid"
Source   Edit  
ACMEChallengeToken = string
Source   Edit  
ACMEChallengeType {.pure.} = enum
  DNS01 = "dns-01", HTTP01 = "http-01", TLSALPN01 = "tls-alpn-01",
  DNSPersist01 = "dns-persist-01"
Source   Edit  
ACMECheckKind = enum
  ACMEOrderCheck, ACMEChallengeCheck
Source   Edit  
ACMECheckResponse = object
  case
  of ACMEOrderCheck:
  of ACMEChallengeCheck:
Source   Edit  
ACMECompletedResponse = object
Source   Edit  
ACMEDirectory = object
  newNonce*: string
  newOrder*: string
  newAccount*: string
Source   Edit  
ACMEFinalizeResponse = object
Source   Edit  
ACMEOrderResponse = object
Source   Edit  
ACMEOrderStatus {.pure.} = enum
  PENDING = "pending", READY = "ready", PROCESSING = "processing",
  VALID = "valid", INVALID = "invalid"
Source   Edit  
ACMERegisterRequest = object
Source   Edit  
ACMERegisterResponse = object
  kid*: Kid
  status*: ACMEAccountStatus
Source   Edit  
Authorization = string
Source   Edit  
Domain = string
Source   Edit  
HTTPResponse = object
  body*: JsonNode
  headers*: HttpTable
Source   Edit  
Kid = string
Source   Edit  
Nonce = string
Source   Edit  

Consts

LetsEncryptURL = "https://acme-v02.api.letsencrypt.org"
Source   Edit  
LetsEncryptURLStaging = "https://acme-staging-v02.api.letsencrypt.org"
Source   Edit  

Procs

proc certificateFinalized(self: ACMEApi; domain: Domain; finalize: Uri;
                          order: Uri; certKeyPair: RsaPrivateKey;
                          key: RsaPrivateKey; kid: Kid;
                          retries: int = DefaultFinalizeRetries): InternalRaisesFuture[
    bool, (ACMEError, CancelledError)] {....stackTrace: false, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Source   Edit  
proc checkCertFinalized(self: ACMEApi; order: Uri; key: RsaPrivateKey; kid: Kid;
                        retries: int = DefaultChalCompletedRetries): InternalRaisesFuture[
    bool, (ACMEError, CancelledError)] {....stackTrace: false, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Source   Edit  
proc checkChallengeCompleted(self: ACMEApi; checkURL: Uri; key: RsaPrivateKey;
                             kid: Kid;
                             retries: int = DefaultChalCompletedRetries): InternalRaisesFuture[
    bool, (ACMEError, CancelledError)] {....stackTrace: false, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Source   Edit  
proc close(self: ACMEApi): InternalRaisesFuture[void, (CancelledError,)] {.
    ...stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc completeChallenge(self: ACMEApi; chalURL: Uri; key: RsaPrivateKey;
                       kid: Kid; retries: int = DefaultChalCompletedRetries): InternalRaisesFuture[
    bool, (ACMEError, CancelledError)] {....stackTrace: false, raises: [], gcsafe,
    tags: [RootEffect], forbids: [].}
Source   Edit  
proc downloadCertificate(self: ACMEApi; order: Uri): InternalRaisesFuture[
    ACMECertificateResponse, (ACMEError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc new(T: typedesc[ACMEApi]; acmeServerURL: Uri = parseUri(LetsEncryptURL)): ACMEApi
Source   Edit  
proc requestAuthorizations(self: ACMEApi; authorizations: seq[Authorization];
                           key: RsaPrivateKey; kid: Kid): InternalRaisesFuture[
    ACMEAuthorizationsResponse, (ACMEError, CancelledError)] {.
    ...stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc requestChallenge(self: ACMEApi; domains: seq[Domain]; key: RsaPrivateKey;
                      kid: Kid): InternalRaisesFuture[
    ACMEChallengeDns01Response, (ACMEError, CancelledError)] {.
    ...stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc requestCheck(self: ACMEApi; checkURL: Uri; checkKind: ACMECheckKind;
                  key: RsaPrivateKey; kid: Kid): InternalRaisesFuture[
    ACMECheckResponse, (ACMEError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc requestFinalize(self: ACMEApi; domain: Domain; finalize: Uri;
                     certKeyPair: RsaPrivateKey; key: RsaPrivateKey; kid: Kid): InternalRaisesFuture[
    ACMEFinalizeResponse, (ACMEError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc requestGetOrder(self: ACMEApi; order: Uri): InternalRaisesFuture[
    ACMEOrderResponse, (ACMEError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc requestNewOrder(self: ACMEApi; domains: seq[Domain]; key: RsaPrivateKey;
                     kid: Kid): InternalRaisesFuture[ACMEChallengeResponse,
    (ACMEError, CancelledError)] {....stackTrace: false, raises: [], gcsafe,
                                   tags: [RootEffect], forbids: [].}
Source   Edit  
proc requestRegister(self: ACMEApi; key: RsaPrivateKey): InternalRaisesFuture[
    ACMERegisterResponse, (ACMEError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
proc sendChallengeCompleted(self: ACMEApi; chalURL: Uri; key: RsaPrivateKey;
                            kid: Kid): InternalRaisesFuture[
    ACMECompletedResponse, (ACMEError, CancelledError)] {....stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  

Methods

method get(self: ACMEApi; uri: Uri): InternalRaisesFuture[HTTPResponse,
    (ACMEError, HttpError, CancelledError)] {.base, ...stackTrace: false,
    raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
method post(self: ACMEApi; uri: Uri; payload: string): InternalRaisesFuture[
    HTTPResponse, (ACMEError, HttpError, CancelledError)] {.base,
    ...stackTrace: false, raises: [], gcsafe, tags: [RootEffect], forbids: [].}
Source   Edit  
method requestNonce(self: ACMEApi): InternalRaisesFuture[Nonce,
    (ACMEError, CancelledError)] {.base, ...stackTrace: false, raises: [], gcsafe,
                                   tags: [RootEffect], forbids: [].}
Source   Edit  

Templates

template handleError(msg: string; body: untyped): untyped
Source   Edit