Skip to content

Commit

Permalink
Add guide on disabling authentication (smithy-lang#1791)
Browse files Browse the repository at this point in the history
* Add guide on disabling authentication

* Update based on PR comments

* move into the authTraits spec

* move content into an example on auth trait

* remove unrendered emphasis
  • Loading branch information
hpmellema authored and Steven Yuan committed Aug 11, 2023
1 parent 846bde8 commit 8bb7a5f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions docs/source-2.0/spec/authentication-traits.rst
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,15 @@ to services and operations:
* ``OperationD`` is annotated with the ``auth`` trait and defines an explicit
list of authentication schemes.

* ``OperationE`` has authentication disabled by setting the ``auth`` trait
value on the operation to an empty list, ``[]``.

.. note::
Disabling authentication for an operation is distinct from applying the
:ref:`@optionalAuth <optionalAuth-trait>` trait to an operation. An
operation with the ``@optionalAuth`` trait must be callable both with and
without authentication.

.. code-block:: smithy
@httpBasicAuth
Expand Down Expand Up @@ -331,6 +340,7 @@ to services and operations:
operations: [
OperationC
OperationD
OperationE
]
}
Expand All @@ -345,6 +355,11 @@ to services and operations:
@auth([httpBearerAuth])
operation OperationD {}
// This operation has the @auth trait and is bound to a service with the
// @auth trait. This operation does not support any authentication schemes.
@auth([])
operation OperationE {}
The following ``auth`` trait is invalid because it references an
authentication scheme trait that is not applied to the service:

Expand Down

0 comments on commit 8bb7a5f

Please sign in to comment.