Files
discogs-service/Sources/DiscogsService/Public/Enumerations/AuthMethod.swift
T
javier b14a9fa816 Documentation improvements (#16)
This PR contains the work done to improve the documentation efforts in the package, aiming at improving the documentation of the source code as well as the OpenAPI specification document. In addition, a breaking bug has been fixed.

Reviewed-on: #16
Co-authored-by: Javier Cicchelli <javier@rock-n-code.com>
Co-committed-by: Javier Cicchelli <javier@rock-n-code.com>
2026-03-24 01:22:53 +00:00

34 lines
1.5 KiB
Swift
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// ===----------------------------------------------------------------------===
//
// This source file is part of the DiscogsService open source project
//
// Copyright (c) 2026 Röck+Cöde VoF. and the DiscogsService project authors
// Licensed under Apache license v2.0
//
// See LICENSE for license information
// See CONTRIBUTORS for the list of DiscogsService project authors
//
// SPDX-License-Identifier: Apache-2.0
//
// ===----------------------------------------------------------------------===
/// A representation of the available authentication methods at the Discogs service.
///
/// The differences between these authentication methods.
///
/// Credentials in request | Rate limiting? | Image URLs? |Authenticated as user?
/// --- | :---: | :---: | :---:
/// None | 🐢 Low tier | No | No
/// Only Consumer key/secret | 🐰 High tier | Yes | No
/// Personal access token | 🐰 High tier | Yes | Yes, for token holder only 👩
///
/// Please refer to the [Discogs documentation](https://www.discogs.com/developers#page:authentication,header:authentication-discogs-auth-flow) for further details.
public enum AuthMethod: Equatable, Sendable {
/// A consumer key and secret that allows access to endpoints that requires authentication.
case consumer(key: String, secret: String)
/// No authentication method defined.
case none
/// A user token that allows access to its own account information.
case user(token: String)
}