Skip to content

Commit

Permalink
Merge pull request #35 from ngrok/nikolay/doc-links
Browse files Browse the repository at this point in the history
Add links to ngrok docs where relevant
  • Loading branch information
nikolay-ngrok authored Oct 26, 2023
2 parents 5b02735 + ebe422c commit 18ac95d
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 47 deletions.
22 changes: 14 additions & 8 deletions ngrok-java/src/main/java/com/ngrok/EndpointBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,33 +17,39 @@ public abstract class EndpointBuilder<T extends EndpointBuilder> extends Metadat
private Optional<String> forwardsTo = Optional.empty();

/**
* Adds a CIDR to the list of allowed CIDRs for this builder.
* Adds a CIDR to the list of allowed CIDRs for this endpoint.
*
* @param allowCIDR The parameter "allowCIDR" is a string that represents a
* Classless Inter-Domain Routing (CIDR) notation. It is used to specify
* a range of IP addresses that are allowed. For example, 10.0.0.0/24
* @return An instance the builder represented by type T
*
* @see <a href="https://ngrok.com/docs/http/ip-restrictions/">IP Restrictions</a>
* in the ngrok docs for additional details.
*/
public T allowCIDR(String allowCIDR) {
this.allowCIDR.add(allowCIDR);
return (T) this;
}

/**
* Adds a CIDR to the list of denied CIDRs for this builder.
* Adds a CIDR to the list of denied CIDRs for this endpoint.
*
* @param denyCIDR The parameter "denyCIDR" is a string that represents a
* Classless Inter-Domain Routing (CIDR) notation. It is used to specify a
* range of IP addresses that should be denied access. For example, 10.0.0.0/24
* @return An instance the builder represented by type T
*
* @see <a href="https://ngrok.com/docs/http/ip-restrictions/">IP Restrictions</a>
* in the ngrok docs for additional details.
*/
public T denyCIDR(String denyCIDR) {
this.denyCIDR.add(denyCIDR);
return (T) this;
}

/**
* Sets the proxy protocol for this builder.
* Sets the proxy protocol for this endpoint.
*
* @param proxyProto the proxy protocol for the builder
* @return An instance the builder represented by type T
Expand All @@ -54,7 +60,7 @@ public T proxyProto(ProxyProto proxyProto) {
}

/**
* Sets the forwarding address for this builder.
* Sets the forwarding address for this endpoint.
*
* @param forwardsTo the forwarding address for the builder
* @return An instance the builder represented by type T
Expand All @@ -65,7 +71,7 @@ public T forwardsTo(String forwardsTo) {
}

/**
* Returns a list of strings representing allowed CIDR addresses.
* Returns a list of strings representing allowed CIDR addresses for this endpoint.
*
* @return the currently set allow CIDR addresses
*/
Expand All @@ -74,7 +80,7 @@ public List<String> getAllowCIDR() {
}

/**
* Returns a list of strings representing denied CIDR addresses.
* Returns a list of strings representing denied CIDR addresses for this endpoint.
*
* @return the currently set deny CIDR addresses
*/
Expand All @@ -92,7 +98,7 @@ public ProxyProto getProxyProto() {
}

/**
* Returns the version of the proxy protocol for this builder.
* Returns the version of the proxy protocol for this endpoint.
*
* @return the currently set version of the proxy protocol
*/
Expand All @@ -101,7 +107,7 @@ public long getProxyProtoVersion() {
}

/**
* Returns the forwarding address for this builder.
* Returns the forwarding address for this endpoint.
*
* @return the currently set forwarding address
*/
Expand Down
12 changes: 12 additions & 0 deletions ngrok-java/src/main/java/com/ngrok/Http.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,9 @@ public String getValue() {

/**
* Represents basic authentication options for an HTTP listener.
*
* @see <a href="https://ngrok.com/docs/http/basic-auth/">Basic Auth</a>
* in the ngrok docs for additional details.
*/
class BasicAuth {
private final String username;
Expand Down Expand Up @@ -100,6 +103,9 @@ public String getPassword() {

/**
* Represents OAuth configuration for an HTTP listener.
*
* @see <a href="https://ngrok.com/docs/http/oauth/">OAuth</a>
* in the ngrok docs for additional details.
*/
class OAuth {
private final String provider;
Expand Down Expand Up @@ -230,6 +236,9 @@ public List<String> getScopes() {

/**
* Represents OIDC configuration for an HTTP listener.
*
* @see <a href="https://ngrok.com/docs/http/openid-connect/">OpenID Connect</a>
* in the ngrok docs for additional details.
*/
class OIDC {
private final String issuerUrl;
Expand Down Expand Up @@ -343,6 +352,9 @@ public List<String> getScope() {

/**
* Represents webhook verification options for an HTTP listener.
*
* @see <a href="https://ngrok.com/docs/http/webhook-verification/">Webhook Verification</a>
* in the ngrok docs for additional details.
*/
class WebhookVerification {
private final String provider;
Expand Down
Loading

0 comments on commit 18ac95d

Please sign in to comment.