forked from linuxfoundation/lfx-v2-auth-service
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathidentity.go
More file actions
40 lines (35 loc) · 1.63 KB
/
identity.go
File metadata and controls
40 lines (35 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright The Linux Foundation and each contributor to LFX.
// SPDX-License-Identifier: MIT
package model
// LinkIdentity represents a request to link a verified email identity to a user account.
type LinkIdentity struct {
// User contains the authenticated user's information needed to authorize the linking action.
User struct {
// UserID is the ID of the user to be linked.
UserID string `json:"user_id"`
// AuthToken is the JWT token with the proper scope to link an identity to a user account.
AuthToken string `json:"auth_token"`
} `json:"user"`
// LinkWith contains the identity information of the user to be linked.
LinkWith struct {
// IdentityToken is the ID token obtained from the passwordless verification flow.
IdentityToken string `json:"identity_token"`
} `json:"link_with"`
}
// UnlinkIdentity represents a request to unlink a secondary identity from a user account.
type UnlinkIdentity struct {
// User contains the authenticated user's information needed to authorize the unlinking action.
User struct {
// UserID is the primary user's ID, populated from the auth_token sub claim.
UserID string `json:"user_id"`
// AuthToken is the JWT token with the update:current_user_identities scope.
AuthToken string `json:"auth_token"`
} `json:"user"`
// Unlink contains the secondary identity to be removed.
Unlink struct {
// Provider is the identity provider of the secondary account (e.g. "google-oauth2", "auth0").
Provider string `json:"provider"`
// IdentityID is the identity's user_id as returned by the identity provider (the part after the "|").
IdentityID string `json:"identity_id"`
} `json:"unlink"`
}