oak-pay-business/es/oak-app-domain/OauthUser/Storage.js

63 lines
1.4 KiB
JavaScript

import { actions } from "./Action";
export const desc = {
attributes: {
userId: {
type: "ref",
ref: "user"
},
applicationId: {
notNull: true,
type: "ref",
ref: "application"
},
providerConfigId: {
notNull: true,
type: "ref",
ref: "oauthProvider"
},
providerUserId: {
notNull: true,
type: "varchar",
params: {
length: 256
}
},
rawUserInfo: {
notNull: true,
type: "object"
},
// 令牌 10-21: 不知道为什么老超出,设置大一点
accessToken: {
notNull: true,
type: "varchar",
params: {
length: 1024
}
},
refreshToken: {
type: "varchar",
params: {
length: 1024
}
},
accessExpiresAt: {
notNull: true,
type: "datetime"
},
refreshExpiresAt: {
type: "datetime"
},
stateId: {
notNull: true,
type: "ref",
ref: "oauthState"
},
loadState: {
type: "enum",
enumeration: ["unload", "loaded"]
}
},
actionType: "crud",
actions
};