added site scope
parent
a2e548c261
commit
a3619240e6
|
@ -0,0 +1,124 @@
|
|||
/**
|
||||
*
|
||||
*/
|
||||
package org.mitre.oauth2.model;
|
||||
|
||||
import javax.persistence.Basic;
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.GeneratedValue;
|
||||
import javax.persistence.GenerationType;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.NamedQueries;
|
||||
import javax.persistence.NamedQuery;
|
||||
import javax.persistence.Table;
|
||||
|
||||
/**
|
||||
* @author jricher
|
||||
*
|
||||
*/
|
||||
@Entity
|
||||
@Table(name = "system_scope")
|
||||
@NamedQueries({
|
||||
@NamedQuery(name = "SystemScope.findAll", query = "select s from SystemScope s"),
|
||||
@NamedQuery(name = "SystemScope.getByValue", query = "select s from SystemScope s WHERE value = :value")
|
||||
})
|
||||
public class SystemScope {
|
||||
|
||||
private Long id;
|
||||
private String value; // scope value
|
||||
private String description; // human-readable description
|
||||
private String icon; // class of the icon to display on the auth page
|
||||
private boolean allowDynReg; // can a dynamically registered client ask for this scope?
|
||||
private boolean defaultScope; // is this a default scope for newly-registered clients?
|
||||
|
||||
/**
|
||||
* @return the id
|
||||
*/
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id")
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
/**
|
||||
* @param id the id to set
|
||||
*/
|
||||
public void setId(Long id) {
|
||||
this.id = id;
|
||||
}
|
||||
/**
|
||||
* @return the value
|
||||
*/
|
||||
@Basic
|
||||
@Column(name = "scope")
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
/**
|
||||
* @param value the value to set
|
||||
*/
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
/**
|
||||
* @return the description
|
||||
*/
|
||||
@Basic
|
||||
@Column(name = "description")
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
/**
|
||||
* @param description the description to set
|
||||
*/
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
/**
|
||||
* @return the icon
|
||||
*/
|
||||
@Basic
|
||||
@Column(name = "icon")
|
||||
public String getIcon() {
|
||||
return icon;
|
||||
}
|
||||
/**
|
||||
* @param icon the icon to set
|
||||
*/
|
||||
public void setIcon(String icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
/**
|
||||
* @return the allowDynReg
|
||||
*/
|
||||
@Basic
|
||||
@Column(name = "allow_dyn_reg")
|
||||
public boolean isAllowDynReg() {
|
||||
return allowDynReg;
|
||||
}
|
||||
/**
|
||||
* @param allowDynReg the allowDynReg to set
|
||||
*/
|
||||
public void setAllowDynReg(boolean allowDynReg) {
|
||||
this.allowDynReg = allowDynReg;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the defaultScope
|
||||
*/
|
||||
@Basic
|
||||
@Column(name = "default_scope")
|
||||
public boolean isDefaultScope() {
|
||||
return defaultScope;
|
||||
}
|
||||
/**
|
||||
* @param defaultScope the defaultScope to set
|
||||
*/
|
||||
public void setDefaultScope(boolean defaultScope) {
|
||||
this.defaultScope = defaultScope;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
|
@ -160,6 +160,15 @@ CREATE TABLE IF NOT EXISTS token_scope (
|
|||
scope VARCHAR(2048)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS site_scope (
|
||||
id BIGINT GENERATED BY DFAULT AS IDENTITY(START WITH 1) PRIMARY KEY,
|
||||
scope VARCHAR(1024),
|
||||
description VARCHAR(4096),
|
||||
icon VARCHAR(256),
|
||||
allow_dyn_reg BOOLEAN,
|
||||
default_scope BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_info (
|
||||
id BIGINT GENERATED BY DEFAULT AS IDENTITY(START WITH 1) PRIMARY KEY,
|
||||
sub VARCHAR(256),
|
||||
|
|
|
@ -155,6 +155,15 @@ CREATE TABLE token_scope (
|
|||
scope VARCHAR(2048)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS site_scope (
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
scope VARCHAR(1024),
|
||||
description VARCHAR(4096),
|
||||
icon VARCHAR(256),
|
||||
allow_dyn_reg BOOLEAN,
|
||||
default_scope BOOLEAN
|
||||
);
|
||||
|
||||
CREATE TABLE user_info (
|
||||
id BIGINT AUTO_INCREMENT PRIMARY KEY,
|
||||
sub VARCHAR(256),
|
||||
|
|
Loading…
Reference in New Issue