Package com.ngrok.definitions
Class Credential
java.lang.Object
com.ngrok.definitions.Credential
A class encapsulating the
Credential
resource.-
Constructor Summary
ConstructorDescriptionCredential
(String id, URI uri, OffsetDateTime createdAt, String description, String metadata, Optional<String> token, List<String> acl) Creates a new instance ofCredential
. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getAcl()
optional list of ACL rules.timestamp when the tunnel credential was created, RFC 3339 formathuman-readable description of who or what will use the credential to authenticate.getId()
unique tunnel credential resource identifierarbitrary user-defined machine-readable data of this credential.getToken()
the credential's authtoken that can be used to authenticate an ngrok agent.getUri()
URI of the tunnel credential API resourceint
hashCode()
toString()
-
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 ofCredential
.- Parameters:
id
- unique tunnel credential resource identifieruri
- URI of the tunnel credential API resourcecreatedAt
- timestamp when the tunnel credential was created, RFC 3339 formatdescription
- 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 thebind
rule. Thebind
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 rulebind: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 ofbind:*.example.com
which will allowx.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
unique tunnel credential resource identifier- Returns:
- the value of the property as a
String
-
getUri
URI of the tunnel credential API resource- Returns:
- the value of the property as a
URI
-
getCreatedAt
timestamp when the tunnel credential was created, RFC 3339 format- Returns:
- the value of the property as a
OffsetDateTime
-
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
arbitrary user-defined machine-readable data of this credential. Optional, max 4096 bytes.- Returns:
- the value of the property as a
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. -
getAcl
optional list of ACL rules. If unspecified, the credential will have no restrictions. The only allowed ACL rule at this time is thebind
rule. Thebind
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 rulebind: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 ofbind:*.example.com
which will allowx.example.com
,y.example.com
,*.example.com
, etc. A rule of'*'
is equivalent to no acl at all and will explicitly permit all actions. -
equals
-
hashCode
public int hashCode() -
toString
-