Skip to content

Commit

Permalink
Support AuthN usernames (GEA-14495) (#251)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenany authored Jun 5, 2024
1 parent 853995a commit c805d2a
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `return_context` support in Audit `/search`, `/results` and `/download` endpoints
- Redact `/unredact` endpoint support
- `redaction_method_overrides` field support in `/redact` and `redact_structured` endpoints
- AuthN usernames support.

### Removed

Expand Down
64 changes: 36 additions & 28 deletions pangea-sdk/v3/service/authn/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,9 @@ type UserCreateRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest

Email string `json:"email"`
Profile ProfileData `json:"profile"`
Email string `json:"email"` // An email address.
Profile ProfileData `json:"profile"` // A user profile as a collection of string properties.
Username string `json:"username,omitempty"` // A username.
}

type UserCreateResult struct {
Expand Down Expand Up @@ -191,8 +192,9 @@ type UserDeleteRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest

Email string `json:"email,omitempty"`
ID string `json:"id,omitempty"`
Email string `json:"email,omitempty"` // An email address.
ID string `json:"id,omitempty"` // The identity of a user or a service.
Username string `json:"username,omitempty"` // A username.
}

type UserDeleteResult struct {
Expand All @@ -216,30 +218,32 @@ func (a *User) Delete(ctx context.Context, input UserDeleteRequest) (*pangea.Pan
}

type UserItem struct {
ID string `json:"id"`
Email string `json:"email"`
Profile ProfileData `json:"profile"`
Verified bool `json:"verified"`
Disabled bool `json:"disabled"`
AcceptedEulaID *string `json:"accepted_eula_id,omitempty"`
AcceptedPrivacyPolicyID *string `json:"accepted_privacy_policy_id,omitempty"`
LastLoginAt *string `json:"last_login_at,omitempty"`
CreatedAt string `json:"created_at"`
ID string `json:"id"` // The identity of a user or a service.
Email string `json:"email"` // An email address.
Username string `json:"username"` // A username.
Profile ProfileData `json:"profile"` // A user profile as a collection of string properties.
Verified bool `json:"verified"` // True if the user's email has been verified.
Disabled bool `json:"disabled"` // True if the service administrator has disabled user account.
AcceptedEulaID *string `json:"accepted_eula_id,omitempty"` // An ID for an agreement.
AcceptedPrivacyPolicyID *string `json:"accepted_privacy_policy_id,omitempty"` // An ID for an agreement.
LastLoginAt *string `json:"last_login_at,omitempty"` // A time in ISO-8601 format.
CreatedAt string `json:"created_at"` // A time in ISO-8601 format.
LoginCount int `json:"login_count"`
LastLoginIP *string `json:"last_login_ip,omitempty"`
LastLoginCity *string `json:"last_login_city,omitempty"`
LastLoginCountry *string `json:"last_login_country,omitempty"`
Authenticators []Authenticator `json:"authenticators"`
Authenticators []Authenticator `json:"authenticators"` // A list of authenticators.
}

type UserUpdateRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest

ID *string `json:"id,omitempty"`
Email *string `json:"email,omitempty"`
Disabled *bool `json:"disabled,omitempty"`
Unlock *bool `json:"unlock,omitempty"`
ID *string `json:"id,omitempty"` // The identity of a user or a service.
Email *string `json:"email,omitempty"` // An email address.
Username *string `json:"username,omitempty"` // A username.
Disabled *bool `json:"disabled,omitempty"` // New disabled value. Disabling a user account will prevent them from logging in.
Unlock *bool `json:"unlock,omitempty"` // Unlock a user account if it has been locked out due to failed authentication attempts.
}

type UserUpdateResult struct {
Expand Down Expand Up @@ -479,8 +483,9 @@ type UserProfileGetRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest

ID *string `json:"id,omitempty"`
Email *string `json:"email,omitempty"`
ID *string `json:"id,omitempty"` // The identity of a user or a service.
Email *string `json:"email,omitempty"` // An email address.
Username *string `json:"username,omitempty"` // A username.
}

type UserProfileGetResult struct {
Expand Down Expand Up @@ -508,9 +513,10 @@ type UserProfileUpdateRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest

Profile ProfileData `json:"profile"`
ID *string `json:"id,omitempty"`
Email *string `json:"email,omitempty"`
Profile ProfileData `json:"profile"` // Updates to a user profile.
ID *string `json:"id,omitempty"` // The identity of a user or a service.
Email *string `json:"email,omitempty"` // An email address.
Username *string `json:"username,omitempty"` // A username.
}

type UserProfileUpdateResult struct {
Expand Down Expand Up @@ -935,9 +941,10 @@ type UserAuthenticatorsDeleteRequest struct {
// Base request has ConfigID for multi-config projects
pangea.BaseRequest

ID *string `json:"id,omitempty"`
Email *string `json:"email,omitempty"`
AuthenticatorID string `json:"authenticator_id"`
ID *string `json:"id,omitempty"` // The identity of a user or a service.
Email *string `json:"email,omitempty"` // An email address.
Username *string `json:"username,omitempty"` // A username.
AuthenticatorID string `json:"authenticator_id"` // An ID for an authenticator.
}

type UserAuthenticatorsDeleteResult struct {
Expand All @@ -964,8 +971,9 @@ func (a *UserAuthenticators) Delete(ctx context.Context, input UserAuthenticator
type UserAuthenticatorsListRequest struct {
pangea.BaseRequest

ID *string `json:"id,omitempty"`
Email *string `json:"email,omitempty"`
ID *string `json:"id,omitempty"` // The identity of a user or a service.
Email *string `json:"email,omitempty"` // An email address.
Username *string `json:"username,omitempty"` // A username.
}

type Authenticator struct {
Expand Down

0 comments on commit c805d2a

Please sign in to comment.