Coverage for /opt/conda/envs/apienv/lib/python3.10/site-packages/daiquiri/core/schema/session.py: 100%

14 statements  

« prev     ^ index     » next       coverage.py v7.6.5, created at 2024-11-15 02:12 +0000

1#!/usr/bin/env python 

2# -*- coding: utf-8 -*- 

3from marshmallow import Schema, fields 

4 

5from daiquiri.core.schema.validators import ValidatedRegexp 

6 

7import logging 

8 

9logger = logging.getLogger(__name__) 

10 

11 

12class SessionListSchema(Schema): 

13 """Deliberately exclude token""" 

14 

15 operator = fields.Bool( 

16 metadata={"description": "Denotes if this session is the current operator"} 

17 ) 

18 last_access = fields.Float( 

19 metadata={"description": "Last epoch time that this session was seen"} 

20 ) 

21 sessionid = fields.UUID(metadata={"description": "The uuid of the session"}) 

22 data = fields.Dict() 

23 operator_pending = fields.Bool() 

24 mirrored = fields.Bool() 

25 

26 

27class SignSchema(Schema): 

28 url = ValidatedRegexp( 

29 "path", metadata={"description": "Url to sign"}, required=True 

30 ) 

31 bewit = fields.Str(metadata={"description": "The signed bewit"})