From 762d6159c68649b6f8b93656ee5c69b64ac502c6 Mon Sep 17 00:00:00 2001 From: Michael Klishin Date: Thu, 3 Oct 2024 22:57:29 -0400 Subject: [PATCH] OAuth 2 client: sync option/1 with rabbit_types, add a comment --- deps/oauth2_client/include/types.hrl | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/deps/oauth2_client/include/types.hrl b/deps/oauth2_client/include/types.hrl index ba73552a24fd..622cae22202c 100644 --- a/deps/oauth2_client/include/types.hrl +++ b/deps/oauth2_client/include/types.hrl @@ -5,8 +5,9 @@ %% Copyright (c) 2020-2023 VMware, Inc. or its affiliates. All rights reserved. %% -%% The closest we have to a type import in Erlang --type(option(T) :: T | 'undefined'). +%% Matches the option type in rabbit_types without introducing a dependency +%% on that module and RabbitMQ core (rabbit_common) +-type(option(T) :: T | 'none' | 'undefined'). -type oauth_provider_id() :: root | binary(). @@ -47,9 +48,10 @@ -record(successful_access_token_response, { access_token :: binary(), token_type :: binary(), - refresh_token :: option(binary()), % A refresh token SHOULD NOT be included - % .. for client-credentials flow. - % https://www.rfc-editor.org/rfc/rfc6749#section-4.4.3 + %% Note: a refresh token SHOULD NOT be included + %% ... for client-credentials flow. + %% See https://www.rfc-editor.org/rfc/rfc6749#section-4.4.3 + refresh_token :: option(binary()), expires_in :: option(integer()) }).