Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add guide on disabling authentication #1791

Merged
merged 5 commits into from
Jun 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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