2022-08-25 19:26:29 -06:00
|
|
|
package models
|
|
|
|
|
2022-09-13 19:02:26 -06:00
|
|
|
import (
|
|
|
|
"github.com/fastenhealth/fastenhealth-onprem/backend/pkg"
|
|
|
|
"github.com/google/uuid"
|
|
|
|
)
|
2022-08-27 09:17:09 -06:00
|
|
|
|
2022-08-30 20:03:24 -06:00
|
|
|
// Source Data/Medical Provider Credentials
|
|
|
|
type Source struct {
|
|
|
|
ModelBase
|
2022-09-13 19:02:26 -06:00
|
|
|
User User `json:"user,omitempty"`
|
|
|
|
UserID uuid.UUID `json:"user_id" gorm:"uniqueIndex:idx_user_source_patient"`
|
|
|
|
SourceType pkg.SourceType `json:"source_type" gorm:"uniqueIndex:idx_user_source_patient"`
|
|
|
|
PatientId string `json:"patient_id" gorm:"uniqueIndex:idx_user_source_patient"`
|
2022-08-25 19:26:29 -06:00
|
|
|
|
2022-08-25 22:57:29 -06:00
|
|
|
OauthEndpointBaseUrl string `json:"oauth_endpoint_base_url"`
|
|
|
|
ApiEndpointBaseUrl string `json:"api_endpoint_base_url"`
|
|
|
|
ClientId string `json:"client_id"`
|
|
|
|
RedirectUri string `json:"redirect_uri"`
|
|
|
|
Scopes string `json:"scopes"`
|
|
|
|
AccessToken string `json:"access_token"`
|
|
|
|
RefreshToken string `json:"refresh_token"`
|
|
|
|
IdToken string `json:"id_token"`
|
|
|
|
ExpiresAt int64 `json:"expires_at"`
|
|
|
|
CodeChallenge string `json:"code_challenge"`
|
|
|
|
CodeVerifier string `json:"code_verifier"`
|
2022-08-25 19:26:29 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
serverUrl: connectData.message.api_endpoint_base_url,
|
|
|
|
clientId: connectData.message.client_id,
|
|
|
|
redirectUri: connectData.message.redirect_uri,
|
|
|
|
tokenUri: `${connectData.message.oauth_endpoint_base_url}/token`,
|
|
|
|
scope: connectData.message.scopes.join(' '),
|
|
|
|
tokenResponse: payload,
|
|
|
|
expiresAt: getAccessTokenExpiration(payload, new BrowserAdapter()),
|
|
|
|
codeChallenge: codeChallenge,
|
|
|
|
codeVerifier: codeVerifier
|
|
|
|
|
|
|
|
*/
|