Entity Definition

services/functions/data/sessions.ts
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
export const Session = new Entity({
    name: "Session",
    timestamps: true,
    attributes: {
      sessionID: { 
        partitionKey: true, 
        prefix: "Session|" 
      },
      
      principalID: { 
        sortKey: true,
        prefix: "Principal|"
      },
  
      expiry: {
        default: () => {dayjs().add(1, "hour").unix}
      },
      
      authorizationMechanism: {
        type: "string",
        required: true,
      },

      authorizationOrigin: {
        type: "string",
        required: true,
      }
    },
    
    table: SessionTable,
  });
D
Image of Dylan Lacey
Dylan Lacey
@dylanlacey
powered byLogosnappify