MASDKAccessTokenScopes

public struct MASDKAccessTokenScopes : Codable, Hashable, Comparable

Mini App access token permissions containing audience and scopes, usually taken from manifest.json

  • Access token audience string

    Declaration

    Swift

    public var audience: String
  • List of scopes that is available for the audience

    Declaration

    Swift

    public var scopes: [String]
  • Constructor for MASDKAccessTokenScopes

    Declaration

    Swift

    public init?(audience: String?, scopes: [String]?)
  • Method to perform Hash

    Declaration

    Swift

    public func hash(into hasher: inout Hasher)

    Parameters

    hasher

    Hasher value

  • Method to compare MiniAppManifest

    Declaration

    Swift

    public static func == (lhs: `Self`, rhs: `Self`) -> Bool

    Return Value

    Whether both manifest values are equal or not

  • Method to check if manifest access token is lesser than the other one

    Declaration

    Swift

    public static func < (lhs: MASDKAccessTokenScopes, rhs: MASDKAccessTokenScopes) -> Bool

    Return Value

    Whether lhs audience is lesser than the rhs audience

  • This method checks if this Access Token permission is contained in an array of permissions by checking audience and scopes. Scopes can be partially provided. Here is an example:

    { “audience”: “rae”, “scopes”: [“memberinfo_read_point”] }

    is part of

    { “accessTokenPermissions”: [ { “audience”: “rae”, “scopes”: [“idinfo_read_openid”, “memberinfo_read_point”] }, { “audience”: “api-c”, “scopes”: [“your_service_scope_here”] } ] }

    Declaration

    Swift

    public func isPartOf(_ fullScopes: [`Self`]) -> Bool

    Parameters

    fullScopes

    an array containing the Access Token permissions we want to compare this one

    Return Value

    a boolean stating if this access token permission is contained in fullScopes array