anchor.diff:          end,
       Steps =
           [ CheckParamPresence
  -        , ReadParamValues
           , ParseSigMethod
           , ParseCallbackURI
           , ConsArgs
  
positive.code:                         of  []    -> []
                          ;   [_|_] -> [{parameters_missing, ParamsMissing}]
                          end,
                      Errors = ErrorDups ++ ErrorMissing,
                      {error, {bad_request, Errors}}
              end
          end,
      ReadParamValues =
          fun (ok) ->
              P0 = ParamPairsGiven,
              {{some, Realm}        , P1} = hope_kv_list:pop(P0, ?PARAM_REALM),
              {{some, ConsumerKey}  , P2} = hope_kv_list:pop(P1, ?PARAM_CONSUMER_KEY),
              {{some, SigGiven}     , P3} = hope_kv_list:pop(P2, ?PARAM_SIGNATURE),
              {{some, SigMethodBin} , P4} = hope_kv_list:pop(P3, ?PARAM_SIGNATURE_METHOD),
              {{some, Timestamp}    , P5} = hope_kv_list:pop(P4, ?PARAM_TIMESTAMP),
              {{some, Nonce}        , P6} = hope_kv_list:pop(P5, ?PARAM_NONCE),
              {{some, CallbackBin}  , P7} = hope_kv_list:pop(P6, ?PARAM_CALLBACK),
              {VersionOpt           , P8} = hope_kv_list:pop(P7, ?PARAM_VERSION),
              ParamPairsRemaining = P8,
              case ParamPairsRemaining
              of  [_|_]=ParamsUnsupported0 ->
                      ParamsUnsupported = [K || {K, _V} <- ParamsUnsupported0],
                      Error = {parameters_unsupported, ParamsUnsupported},
                      {error, {bad_request, [Error]}}
              ;   [] ->
                      ParamsGiven = #given_parameters
                          { realm            = {some, Realm}
                          , consumer_key     = {some, ConsumerKey}
                          , signature        = {some, SigGiven}
                          , signature_method = {some, SigMethodBin}
                          , timestamp        = {some, Timestamp}
                          , nonce            = {some, Nonce}
                          , callback         = {some, CallbackBin}
                          , version          = VersionOpt
                          },
                      {ok, ParamsGiven}
              end
          end,
      ParseSigMethod  =
          fun (#given_parameters{}=ParamsGiven) ->
              {some, SigMethBin} = ParamsGiven#given_parameters.signature_method,
              case ?signature:method_of_bin(SigMethBin)
              of  {ok, SigMethod} ->
                      {ok, {ParamsGiven, SigMethod}}
              ;   {error, {signature_method_unsupported, SigMethBin}=Error} ->
                      {error, {bad_request, [Error]}}
              end
          end,
      ParseCallbackURI  =
          fun ({#given_parameters{}=ParamsGiven, SigMeth}) ->
              {some, CallbackBin} = ParamsGiven#given_parameters.callback,
              case ?uri:of_bin(CallbackBin)
              of  {ok, CallbackURI} ->
                      {ok, {ParamsGiven, SigMeth, CallbackURI}}
              ;   {error, _} ->
                      Error = {callback_uri_invalid, CallbackBin},
                      {error, {bad_request, [Error]}}
              end
          end,
      ConsArgs =
          fun ({#given_parameters{}=ParamsGiven, SigMethod, CallbackURI}) ->
              #given_parameters
              { realm            = {some, Realm}
              , consumer_key     = {some, ConsumerKey}
              , signature        = {some, SigGiven}
              , signature_method = {some, _}
              , timestamp        = {some, Timestamp}
              , nonce            = {some, Nonce}
              , callback         = {some, _}
              , version          = VersionOpt
              } = ParamsGiven,
              InitiateArgs = #oauth1_server_args_initiate
                  { resource            = ?resource:cons(Realm, ResourceURI)
                  , consumer_key        = {client, ConsumerKey}
  
negative.code: 
  -type common_sig_params() ::
      #common_sig_params{}.
  
  
  %%=============================================================================
  