allow setting firebase api key while sending enrollment callback
Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
parent
c90d35b113
commit
76498a2d7b
|
@ -53,19 +53,19 @@ class MobileDeviceCheckInSerializer(PassiveSerializer):
|
||||||
info = MobileDeviceInfoSerializer()
|
info = MobileDeviceInfoSerializer()
|
||||||
|
|
||||||
|
|
||||||
class MobileDeviceEnrollmentSerializer(PassiveSerializer):
|
|
||||||
"""Enrollment request, send the device's unique identifier"""
|
|
||||||
|
|
||||||
device_uid = CharField(required=True)
|
|
||||||
info = MobileDeviceInfoSerializer()
|
|
||||||
|
|
||||||
|
|
||||||
class MobileDeviceSetPushKeySerializer(PassiveSerializer):
|
class MobileDeviceSetPushKeySerializer(PassiveSerializer):
|
||||||
"""Set notification key"""
|
"""Set notification key"""
|
||||||
|
|
||||||
firebase_key = CharField(required=True)
|
firebase_key = CharField(required=True)
|
||||||
|
|
||||||
|
|
||||||
|
class MobileDeviceEnrollmentSerializer(MobileDeviceSetPushKeySerializer):
|
||||||
|
"""Enrollment request, send the device's unique identifier"""
|
||||||
|
|
||||||
|
device_uid = CharField(required=True)
|
||||||
|
info = MobileDeviceInfoSerializer()
|
||||||
|
|
||||||
|
|
||||||
class MobileDeviceResponseSerializer(PassiveSerializer):
|
class MobileDeviceResponseSerializer(PassiveSerializer):
|
||||||
"""Response from push sent to phone"""
|
"""Response from push sent to phone"""
|
||||||
|
|
||||||
|
@ -120,6 +120,7 @@ class MobileDeviceViewSet(
|
||||||
device.name = data.validated_data["info"]["hostname"]
|
device.name = data.validated_data["info"]["hostname"]
|
||||||
device.confirmed = True
|
device.confirmed = True
|
||||||
device.device_id = data.validated_data["device_uid"]
|
device.device_id = data.validated_data["device_uid"]
|
||||||
|
device.firebase_token = data.validated_data["firebase_key"]
|
||||||
device.save()
|
device.save()
|
||||||
MobileDeviceToken.objects.filter(
|
MobileDeviceToken.objects.filter(
|
||||||
device=device,
|
device=device,
|
||||||
|
|
|
@ -35380,6 +35380,9 @@ components:
|
||||||
type: object
|
type: object
|
||||||
description: Enrollment request, send the device's unique identifier
|
description: Enrollment request, send the device's unique identifier
|
||||||
properties:
|
properties:
|
||||||
|
firebase_key:
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
device_uid:
|
device_uid:
|
||||||
type: string
|
type: string
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
@ -35387,6 +35390,7 @@ components:
|
||||||
$ref: '#/components/schemas/MobileDeviceInfoRequest'
|
$ref: '#/components/schemas/MobileDeviceInfoRequest'
|
||||||
required:
|
required:
|
||||||
- device_uid
|
- device_uid
|
||||||
|
- firebase_key
|
||||||
- info
|
- info
|
||||||
MobileDeviceEnrollmentStatus:
|
MobileDeviceEnrollmentStatus:
|
||||||
type: object
|
type: object
|
||||||
|
|
|
@ -511,6 +511,9 @@ components:
|
||||||
type: object
|
type: object
|
||||||
description: Enrollment request, send the device's unique identifier
|
description: Enrollment request, send the device's unique identifier
|
||||||
properties:
|
properties:
|
||||||
|
firebase_key:
|
||||||
|
type: string
|
||||||
|
minLength: 1
|
||||||
device_uid:
|
device_uid:
|
||||||
type: string
|
type: string
|
||||||
minLength: 1
|
minLength: 1
|
||||||
|
@ -518,6 +521,7 @@ components:
|
||||||
$ref: '#/components/schemas/MobileDeviceInfoRequest'
|
$ref: '#/components/schemas/MobileDeviceInfoRequest'
|
||||||
required:
|
required:
|
||||||
- device_uid
|
- device_uid
|
||||||
|
- firebase_key
|
||||||
- info
|
- info
|
||||||
MobileDeviceEnrollmentStatus:
|
MobileDeviceEnrollmentStatus:
|
||||||
type: object
|
type: object
|
||||||
|
|
Reference in a new issue