-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #19 from appuio/feat/users
Add User and OrganizationMembers Resources
- Loading branch information
Showing
12 changed files
with
695 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:subresource:status | ||
|
||
// OrganizationMembers is the collection of members of an organization | ||
type OrganizationMembers struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec OrganizationMembersSpec `json:"spec,omitempty"` | ||
Status OrganizationMembersStatus `json:"status,omitempty"` | ||
} | ||
|
||
// OrganizationMembersSpec contains the desired members of the organization | ||
type OrganizationMembersSpec struct { | ||
UserRefs []UserRef `json:"userRefs,omitempty"` | ||
} | ||
|
||
// OrganizationMembersStatus contains the actual members of the organization | ||
type OrganizationMembersStatus struct { | ||
ResolvedUserRefs []UserRef `json:"resolvedUserRefs,omitempty"` | ||
} | ||
|
||
// UserRef points to a user | ||
type UserRef struct { | ||
ID string `json:"id,omitempty"` | ||
Username string `json:"username,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// OrganizationMembersList contains a list of OrganizationMembers resources | ||
type OrganizationMembersList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
Items []OrganizationMembers `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&OrganizationMembers{}, &OrganizationMembersList{}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
package v1 | ||
|
||
import ( | ||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" | ||
) | ||
|
||
// +kubebuilder:object:root=true | ||
// +kubebuilder:resource:scope=Cluster | ||
// +kubebuilder:subresource:status | ||
|
||
// User is a representation of a APPUiO Cloud user | ||
type User struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ObjectMeta `json:"metadata,omitempty"` | ||
|
||
Spec UserSpec `json:"spec,omitempty"` | ||
Status UserStatus `json:"status,omitempty"` | ||
} | ||
|
||
// UserSpec contains the desired state of the user | ||
type UserSpec struct { | ||
Preferences UserPreferences `json:"preferences,omitempty"` | ||
} | ||
|
||
// UserPreferences contains the Preferences of the user | ||
type UserPreferences struct { | ||
DefaultOrganizationRef string `json:"defaultOrganizationRef,omitempty"` | ||
} | ||
|
||
// UserStatus contains the acutal state of the user | ||
type UserStatus struct { | ||
DefaultOrganizationRef string `json:"defaultOrganization,omitempty"` | ||
DisplayName string `json:"displayName,omitempty"` | ||
Username string `json:"username,omitempty"` | ||
Email string `json:"email,omitempty"` | ||
} | ||
|
||
// +kubebuilder:object:root=true | ||
|
||
// UserList contains a list of Users. | ||
type UserList struct { | ||
metav1.TypeMeta `json:",inline"` | ||
metav1.ListMeta `json:"metadata,omitempty"` | ||
|
||
Items []User `json:"items"` | ||
} | ||
|
||
func init() { | ||
SchemeBuilder.Register(&User{}, &UserList{}) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.