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 com.fasterxml.jackson.annotation.JsonProperty;
013import com.fasterxml.jackson.annotation.JsonPropertyOrder;
014import io.swagger.v3.oas.annotations.media.Schema;
015
016@Schema(name = "OAuth2Keystore", description = "An OAuth2/OIDC Keystore definition")
017@JsonPropertyOrder(
018                value = {OAuth2KeystoreJson.KEYSTORE_ID, OAuth2KeystoreJson.JSON_KEYS, OAuth2KeystoreJson.FILE_PATH},
019                alphabetic = true)
020public class OAuth2KeystoreJson implements IModelJson {
021        public static final String KEYSTORE_ID = "keystoreId";
022        public static final String JSON_KEYS = "jsonKeys";
023        public static final String FILE_PATH = "filePath";
024        public static final String KEYSTOREID_PATTERN = "[^ ]+";
025
026        @JsonProperty(value = KEYSTORE_ID)
027        @Schema(description = "The user specified ID for this keystore.", accessMode = Schema.AccessMode.READ_ONLY)
028        private String myKeystoreId;
029
030        @JsonProperty(value = JSON_KEYS)
031        @Schema(description = "JSON blob of keys to use. If filePath is defined, this is ignored.")
032        private String myJsonKeys;
033
034        @JsonProperty(value = FILE_PATH)
035        @Schema(
036                        description =
037                                        "A path to the file location that defines the keys. This path uses the format of a [Resource Path](/docs/guide_installation/configuring_smile_cdr.html).")
038        private String myFilePath;
039
040        public void setKeystoreId(String theId) {
041                myKeystoreId = theId;
042        }
043
044        public String getKeystoreId() {
045                return myKeystoreId;
046        }
047
048        public void setJsonKeys(String theJsonBlob) {
049                myJsonKeys = theJsonBlob;
050        }
051
052        public String getJsonKeys() {
053                return myJsonKeys;
054        }
055
056        public void setFilePath(String thePath) {
057                myFilePath = thePath;
058        }
059
060        public String getFilePath() {
061                return myFilePath;
062        }
063}