    def share_model(self, share):
        """Compute the REST API model for a share"""
        return {
            "server": self.server_model(share.spawner),
            "scopes": share.scopes,
            "user": {"name": share.user.name} if share.user else None,
            "group": {"name": share.group.name} if share.group else None,
            "kind": "group" if share.group else "user",
            "created_at": isoformat(share.created_at),
        }
Compute the REST API model for a share
jupyterhub/apihandlers/shares.py