Class Credential

java.lang.Object
com.ngrok.definitions.Credential

public class Credential extends Object
A class encapsulating the Credential resource.
  • Constructor Details

    • Credential

      public Credential(String id, URI uri, OffsetDateTime createdAt, String description, String metadata, Optional<String> token, List<String> acl)
      Creates a new instance of Credential.
      Parameters:
      id - unique tunnel credential resource identifier
      uri - URI of the tunnel credential API resource
      createdAt - timestamp when the tunnel credential was created, RFC 3339 format
      description - human-readable description of who or what will use the credential to authenticate. Optional, max 255 bytes.
      metadata - arbitrary user-defined machine-readable data of this credential. Optional, max 4096 bytes.
      token - the credential's authtoken that can be used to authenticate an ngrok agent. This value is only available one time, on the API response from credential creation, otherwise it is null.
      acl - optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the bind rule. The bind rule allows the caller to restrict what domains and addresses the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind rules may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of bind:*.example.com which will allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is equivalent to no acl at all and will explicitly permit all actions.
  • Method Details

    • getId

      public String getId()
      unique tunnel credential resource identifier
      Returns:
      the value of the property as a String
    • getUri

      public URI getUri()
      URI of the tunnel credential API resource
      Returns:
      the value of the property as a URI
    • getCreatedAt

      public OffsetDateTime getCreatedAt()
      timestamp when the tunnel credential was created, RFC 3339 format
      Returns:
      the value of the property as a OffsetDateTime
    • getDescription

      public String getDescription()
      human-readable description of who or what will use the credential to authenticate. Optional, max 255 bytes.
      Returns:
      the value of the property as a String
    • getMetadata

      public String getMetadata()
      arbitrary user-defined machine-readable data of this credential. Optional, max 4096 bytes.
      Returns:
      the value of the property as a String
    • getToken

      public Optional<String> getToken()
      the credential's authtoken that can be used to authenticate an ngrok agent. This value is only available one time, on the API response from credential creation, otherwise it is null.
      Returns:
      the value of the property as a String wrapped in an Optional
    • getAcl

      public List<String> getAcl()
      optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is the bind rule. The bind rule allows the caller to restrict what domains and addresses the token is allowed to bind. For example, to allow the token to open a tunnel on example.ngrok.io your ACL would include the rule bind:example.ngrok.io. Bind rules may specify a leading wildcard to match multiple domains with a common suffix. For example, you may specify a rule of bind:*.example.com which will allow x.example.com, y.example.com, *.example.com, etc. A rule of '*' is equivalent to no acl at all and will explicitly permit all actions.
      Returns:
      the value of the property as a List of String
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object