001/*-
002 * #%L
003 * Smile CDR - CDR
004 * %%
005 * Copyright (C) 2016 - 2026 Smile CDR, Inc.
006 * %%
007 * All rights reserved.
008 * #L%
009 */
010package ca.cdr.api.model.json;
011
012import jakarta.annotation.Nonnull;
013import jakarta.annotation.Nullable;
014
015import java.util.Set;
016
017public interface IOAuth2ClientDetails {
018        /**
019         * This PID (persistent ID) for this client. This is the internal database
020         * ID for the client and is globally unique across the smile CDR cluster.
021         */
022        Long getPid();
023
024        /**
025         * The node ID that this client is registered against.
026         */
027        String getNodeId();
028
029        /**
030         * The module ID that this client is registered against.
031         */
032        String getModuleId();
033
034        /**
035         * The client ID (used as a primary key, and as a parameter during auth exchange)
036         */
037        @Nonnull
038        String getClientId();
039
040        /**
041         * The client's name (used only for display purposes, may be shown to end users)
042         */
043        @Nullable
044        String getClientName();
045
046        /**
047         * Allowable redirect URIs the client can specify as a part of an auth exchange
048         */
049        @Nonnull
050        Set<String> getRegisteredRedirectUri();
051
052        /**
053         * Scopes that the client is allowed to request?
054         * Callers should not modify the returned collection.
055         */
056        @Nonnull
057        Set<String> getScope();
058
059        /**
060         * Any scopes that will be automatically approved if the client requests them
061         * during authorization, without prompting the user.
062         * Callers should not modify the returned collection.
063         */
064        @Nonnull
065        Set<String> getAutoApproveScopes();
066
067        /**
068         * Any scopes that will be automatically granted to the client even if it does
069         * not request them.
070         * Callers should not modify the returned collection.
071         */
072        @Nonnull
073        Set<String> getAutoGrantScopes();
074
075        /**
076         * Authentication Required. When {@code true}, the client must prove who it is on every token request,
077         * either by sending its client secret or by sending a client assertion signed with one of its keys
078         * (from its JWKS or JWKS URL). When {@code false}, the client can request tokens without credentials.
079         */
080        boolean isSecretRequired();
081
082        /**
083         * Is the client enabled?
084         */
085        boolean isEnabled();
086
087        /**
088         * Was this client created by AppSphere
089         */
090        boolean isCreatedByAppSphere();
091
092        /**
093         * The client's public JWKS
094         */
095        @Nullable
096        String getPublicJwks();
097}