|
@@ -1,46 +1,71 @@
|
|
|
#
|
|
|
-# route.txt - Route and authorization configuration
|
|
|
+# route.txt - Route configuration
|
|
|
#
|
|
|
# Schema
|
|
|
# route uri=URI protocol=PROTOCOL methods=METHODS handler=HANDLER redirect=STATUS@URI \
|
|
|
# extensions=EXTENSIONS abilities=ABILITIES
|
|
|
#
|
|
|
-# Routes may require authentication and that users possess certain abilities.
|
|
|
-# The abilities, extensions, methods and redirect keywords use comma separated tokens to express a set of
|
|
|
+# Abilities are a set of required abilities that the user or request must possess.
|
|
|
+# The abilities, extensions, methods and redirect keywords may use comma separated tokens to express a set of
|
|
|
# required options, or use "|" separated tokens for a set of alternative options. This implements AND/OR.
|
|
|
-# The protocol keyword may be set to http or https. The redirect status may be "*" to match all HTTP status codes.
|
|
|
-# Multiple redirect fields are permissible.
|
|
|
+# The protocol keyword may be set to http or https
|
|
|
+# Multiple redirect fields are permissable
|
|
|
#
|
|
|
-# Examples:
|
|
|
+# Redirect over TLS
|
|
|
+# route uri=/ protocol=http redirect=https handler=redirect
|
|
|
#
|
|
|
-# Universally redirect http to https for secure communications
|
|
|
-# route uri=/ protocol=http redirect=*@https handler=redirect
|
|
|
+# Form based login pattern
|
|
|
+# route uri=/login.html
|
|
|
+# route uri=/action/login methods=POST handler=action redirect=200@/ redirect=401@/login.html
|
|
|
+# route uri=/action/logout methods=POST handler=action redirect=200@/login.html
|
|
|
+# route uri=/ auth=form handler=continue redirect=401@/login.html
|
|
|
#
|
|
|
-# Form based login pattern.
|
|
|
-# route uri=/pub/
|
|
|
-# route uri=/action/login methods=POST handler=action redirect=200@/ redirect=401@/pub/login.html
|
|
|
-# route uri=/action/logout methods=POST handler=action redirect=200@/pub/login.html
|
|
|
-# route uri=/ auth=form handler=continue redirect=401@/pub/login.html
|
|
|
+route uri=/old-alias/ redirect=/alias/atest.html handler=redirect
|
|
|
+
|
|
|
+#
|
|
|
+# Basic and digest authentication required for these directories.
|
|
|
+# Require the "manage" ability which only "joshua" has.
|
|
|
+#
|
|
|
+route uri=/auth/basic/admin/ auth=basic abilities=manage
|
|
|
+route uri=/auth/digest/admin/ auth=digest abilities=manage
|
|
|
+route uri=/auth/basic/ auth=basic abilities=view
|
|
|
+route uri=/auth/digest/ auth=digest abilities=view
|
|
|
+
|
|
|
+#
|
|
|
+# Form-based authentication for content under /auth/form
|
|
|
+# The login form is /auth/form/login.html. The page to display when logged-in is /auth/form/index.html
|
|
|
+# Everything else under /auth/form is secured and requires the "manage" ability
|
|
|
+#
|
|
|
+route uri=/login.html
|
|
|
+
|
|
|
+route uri=/action/login methods=POST handler=action redirect=200@/index.html redirect=401@/login.html
|
|
|
+route uri=/action/logout methods=GET|POST handler=action redirect=200@/login.html
|
|
|
+route uri=/auth/form/ auth=form handler=continue abilities=manage redirect=401@/login.html
|
|
|
+
|
|
|
+route uri=/auth/person auth=digest handler=continue methods=GET|POST abilities=manage redirect=401@/login.html
|
|
|
+
|
|
|
+#route uri=/action/person methods=GET|POST handler=action
|
|
|
+
|
|
|
+#
|
|
|
+# Support PUT and DELETE methods only for the BIT_GOAHEAD_PUT_DIR directory
|
|
|
+#
|
|
|
+route uri=/tmp/ methods=PUT|DELETE
|
|
|
+
|
|
|
#
|
|
|
-# Sample basic or digest authentication for user "joshua"
|
|
|
-# route uri=/auth/basic/ auth=basic abilities=manage
|
|
|
-# route uri=/auth/digest/ auth=digest abilities=manage
|
|
|
+# Require TLS to access anything under /secure
|
|
|
#
|
|
|
-# Eanable the PUT or DELETE methods (only) for the BIT_GOAHEAD_PUT_DIR directory
|
|
|
-# route uri=/put/ methods=PUT|DELETE
|
|
|
+route uri=/secure/ protocol=http redirect=https handler=redirect
|
|
|
+
|
|
|
#
|
|
|
# Standard routes
|
|
|
#
|
|
|
-route uri=/cgi-bin dir=cgi-bin handler=cgi
|
|
|
-route uri=/action handler=action
|
|
|
-route uri=/ extensions=jst handler=jst
|
|
|
+route uri=/cgi-bin handler=cgi
|
|
|
+route uri=/action handler=action auth=form
|
|
|
route uri=/ methods=OPTIONS|TRACE handler=options
|
|
|
-
|
|
|
-# For legacy GoAhead applications using /goform
|
|
|
-route uri=/goform handler=action
|
|
|
+route uri=/ extensions=jst,asp handler=jst
|
|
|
|
|
|
#
|
|
|
# Catch-all route without authentication for all other URIs
|
|
|
#
|
|
|
route uri=/
|
|
|
-route uri=/ extension=jst,html,asp handler=jst
|
|
|
+
|