9a30b69561
This PR contains the work done to implement the *Authentication* endpoints of the Discogs API: * GET `/oauth/request_token` * POST `/oauth/access_token` * GET `/oauth/identity` Reviewed-on: #9 Co-authored-by: Javier Cicchelli <javier@rock-n-code.com> Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
1 line
15 KiB
JSON
1 line
15 KiB
JSON
{"seeAlsoSections":[{"generated":true,"anchor":"Authentication-endpoints","title":"Authentication endpoints","identifiers":["doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getRequestToken(_:)","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getUserIdentity(_:)"]}],"schemaVersion":{"major":0,"minor":3,"patch":0},"abstract":[{"type":"text","text":"Provide required credentials data to obtain an access token."}],"identifier":{"url":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/postAccessToken(_:)","interfaceLanguage":"swift"},"sections":[],"kind":"symbol","metadata":{"role":"symbol","externalID":"s:14DiscogsService6ClientV15postAccessTokenyAA10OperationsO04PosteF0O6OutputOAH5InputVYaKF","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"postAccessToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}],"symbolKind":"method","modules":[{"name":"DiscogsService"}],"roleHeading":"Instance Method","title":"postAccessToken(_:)"},"primaryContentSections":[{"kind":"declarations","declarations":[{"tokens":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"postAccessToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"_","kind":"externalParam"},{"text":" ","kind":"text"},{"text":"input","kind":"internalParam"},{"text":": ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"text":".","kind":"text"},{"text":"Input","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Input","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"text":".","kind":"text"},{"text":"PostAccessToken","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"text":".","kind":"text"},{"text":"Output","kind":"typeIdentifier","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Output","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}],"languages":["swift"],"platforms":["macOS"]}]},{"content":[{"anchor":"discussion","type":"heading","level":2,"text":"Discussion"},{"type":"paragraph","inlineContent":[{"text":"Provide to the service some required credentials details to obtain an access token at the end of the ","type":"text"},{"inlineContent":[{"text":"OAuth","type":"text"}],"type":"emphasis"},{"text":" process.","type":"text"}]},{"type":"paragraph","inlineContent":[{"text":"This endpoint represents the ","type":"text"},{"identifier":"https:\/\/www.discogs.com\/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url","type":"reference","isActive":true},{"text":", thus it requires to configure an ","type":"text"},{"inlineContent":[{"text":"Authorization","type":"text"}],"type":"emphasis"},{"text":" header to have a value like this:","type":"text"}]},{"syntax":null,"code":["OAuth oauth_consumer_key=\"your_consumer_key\", oauth_nonce=\"random_string_or_timestamp\", oauth_token=\"oauth_token_received_from_step_2\" oauth_signature=\"your_consumer_secret&\", oauth_signature_method=\"PLAINTEXT\", oauth_timestamp=\"current_timestamp\", oauth_verifier=\"users_verifier\""],"type":"codeListing"},{"type":"paragraph","inlineContent":[{"text":"For further details about this process, please refer to the ","type":"text"},{"identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","type":"reference","isActive":true},{"text":" section in the ","type":"text"},{"identifier":"https:\/\/www.discogs.com\/developers#page:authentication","type":"reference","isActive":true},{"text":" documentation.","type":"text"}]},{"content":[{"inlineContent":[{"text":"HTTP ","type":"text"},{"type":"codeVoice","code":"POST \/oauth\/access_token"},{"text":".","type":"text"}],"type":"paragraph"}],"name":"Remark","type":"aside","style":"note"},{"content":[{"inlineContent":[{"text":"Generated from ","type":"text"},{"type":"codeVoice","code":"#\/paths\/\/oauth\/access_token\/post(postAccessToken)"},{"text":".","type":"text"}],"type":"paragraph"}],"name":"Remark","type":"aside","style":"note"}],"kind":"content"}],"hierarchy":{"paths":[["doc:\/\/DiscogsService\/documentation\/DiscogsService","doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client"]]},"variants":[{"paths":["\/documentation\/discogsservice\/client\/postaccesstoken(_:)"],"traits":[{"interfaceLanguage":"swift"}]}],"references":{"https://www.discogs.com/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url":{"type":"link","identifier":"https:\/\/www.discogs.com\/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url","titleInlineContent":[{"type":"text","text":"4th step of the OAuth flow process"}],"title":"4th step of the OAuth flow process","url":"https:\/\/www.discogs.com\/developers#header-4.-send-a-post-request-to-the-discogs-access-token-url"},"https://www.discogs.com/developers#page:authentication":{"type":"link","identifier":"https:\/\/www.discogs.com\/developers#page:authentication","titleInlineContent":[{"type":"text","text":"Discogs API authentication"}],"title":"Discogs API authentication","url":"https:\/\/www.discogs.com\/developers#page:authentication"},"doc://DiscogsService/documentation/DiscogsService/Operations":{"url":"\/documentation\/discogsservice\/operations","kind":"symbol","role":"symbol","type":"topic","fragments":[{"kind":"keyword","text":"enum"},{"text":" ","kind":"text"},{"kind":"identifier","text":"Operations"}],"abstract":[{"type":"text","text":"API operations, with input and output types, generated from "},{"type":"codeVoice","code":"#\/paths"},{"text":" in the OpenAPI document.","type":"text"}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations","navigatorTitle":[{"kind":"identifier","text":"Operations"}],"title":"Operations"},"doc://DiscogsService/documentation/DiscogsService/Client":{"url":"\/documentation\/discogsservice\/client","role":"symbol","abstract":[{"type":"text","text":"The Discogs API v2.0 is a RESTful interface to Discogs data. You can access JSON-formatted information about Database objects such as "},{"inlineContent":[{"type":"text","text":"Artists"}],"type":"emphasis"},{"type":"text","text":", "},{"inlineContent":[{"type":"text","text":"Releases"}],"type":"emphasis"},{"type":"text","text":", and "},{"inlineContent":[{"type":"text","text":"Labels"}],"type":"emphasis"},{"type":"text","text":". Your application can also manage "},{"inlineContent":[{"type":"text","text":"User Collections"}],"type":"emphasis"},{"type":"text","text":" and "},{"inlineContent":[{"type":"text","text":"Wantlists"}],"type":"emphasis"},{"type":"text","text":", create "},{"inlineContent":[{"type":"text","text":"Marketplace"}],"type":"emphasis"},{"type":"text","text":" listings, and more."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Client","kind":"identifier"}],"kind":"symbol","type":"topic","title":"Client","navigatorTitle":[{"text":"Client","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Client/getRequestToken(_:)":{"abstract":[{"type":"text","text":"Get details about a OAuth request token."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getRequestToken(_:)","url":"\/documentation\/discogsservice\/client\/getrequesttoken(_:)","title":"getRequestToken(_:)","role":"symbol","type":"topic","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getRequestToken","kind":"identifier"},{"text":"(","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO5InputV","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetRequestToken","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15GetRequestTokenO6OutputO","kind":"typeIdentifier"}]},"doc://DiscogsService/documentation/DiscogsService/Client/getUserIdentity(_:)":{"abstract":[{"type":"text","text":"Get information about an authenticated user."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/getUserIdentity(_:)","url":"\/documentation\/discogsservice\/client\/getuseridentity(_:)","title":"getUserIdentity(_:)","role":"symbol","type":"topic","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"text":"getUserIdentity","kind":"identifier"},{"text":"(","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetUserIdentity","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO5InputV","kind":"typeIdentifier"},{"text":") ","kind":"text"},{"text":"async","kind":"keyword"},{"text":" ","kind":"text"},{"text":"throws","kind":"keyword"},{"text":" -> ","kind":"text"},{"text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"GetUserIdentity","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO","kind":"typeIdentifier"},{"text":".","kind":"text"},{"text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15GetUserIdentityO6OutputO","kind":"typeIdentifier"}]},"doc://DiscogsService/documentation/DiscogsService/Operations/PostAccessToken/Input":{"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Input","title":"Operations.PostAccessToken.Input","url":"\/documentation\/discogsservice\/operations\/postaccesstoken\/input","kind":"symbol","type":"topic","navigatorTitle":[{"text":"Input","kind":"identifier"}],"abstract":[],"role":"symbol","fragments":[{"text":"struct","kind":"keyword"},{"text":" ","kind":"text"},{"text":"Input","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Client/postAccessToken(_:)":{"abstract":[{"type":"text","text":"Provide required credentials data to obtain an access token."}],"identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Client\/postAccessToken(_:)","url":"\/documentation\/discogsservice\/client\/postaccesstoken(_:)","title":"postAccessToken(_:)","role":"symbol","type":"topic","kind":"symbol","fragments":[{"text":"func","kind":"keyword"},{"text":" ","kind":"text"},{"kind":"identifier","text":"postAccessToken"},{"text":"(","kind":"text"},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Input","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO5InputV"},{"kind":"text","text":") "},{"kind":"keyword","text":"async"},{"kind":"text","text":" "},{"text":"throws","kind":"keyword"},{"kind":"text","text":" -> "},{"kind":"typeIdentifier","text":"Operations","preciseIdentifier":"s:14DiscogsService10OperationsO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"PostAccessToken","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO"},{"kind":"text","text":"."},{"kind":"typeIdentifier","text":"Output","preciseIdentifier":"s:14DiscogsService10OperationsO15PostAccessTokenO6OutputO"}]},"https://www.discogs.com/developers#page:authentication,header:authentication-oauth-flow":{"titleInlineContent":[{"text":"OAuth flow","type":"text"}],"url":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","identifier":"https:\/\/www.discogs.com\/developers#page:authentication,header:authentication-oauth-flow","type":"link","title":"OAuth flow"},"doc://DiscogsService/documentation/DiscogsService":{"title":"DiscogsService","abstract":[],"role":"collection","type":"topic","kind":"symbol","url":"\/documentation\/discogsservice","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService"},"doc://DiscogsService/documentation/DiscogsService/Operations/PostAccessToken":{"url":"\/documentation\/discogsservice\/operations\/postaccesstoken","role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken","abstract":[{"text":"Provide required credentials data to obtain an access token.","type":"text"}],"fragments":[{"text":"enum","kind":"keyword"},{"text":" ","kind":"text"},{"text":"PostAccessToken","kind":"identifier"}],"kind":"symbol","type":"topic","title":"Operations.PostAccessToken","navigatorTitle":[{"text":"PostAccessToken","kind":"identifier"}]},"doc://DiscogsService/documentation/DiscogsService/Operations/PostAccessToken/Output":{"url":"\/documentation\/discogsservice\/operations\/postaccesstoken\/output","role":"symbol","identifier":"doc:\/\/DiscogsService\/documentation\/DiscogsService\/Operations\/PostAccessToken\/Output","abstract":[],"fragments":[{"text":"enum","kind":"keyword"},{"kind":"text","text":" "},{"kind":"identifier","text":"Output"}],"kind":"symbol","title":"Operations.PostAccessToken.Output","type":"topic","navigatorTitle":[{"kind":"identifier","text":"Output"}]}}} |