...

Source file src/edge-infra.dev/pkg/edge/bsl-reconciler/types.go

Documentation: edge-infra.dev/pkg/edge/bsl-reconciler

     1  package edgebsl
     2  
     3  import (
     4  	"time"
     5  
     6  	"edge-infra.dev/pkg/edge/bsl"
     7  )
     8  
     9  // BslConfig
    10  type BslConfig struct { //nolint
    11  	ActivationSubscriptionURL string
    12  	RootURI                   string
    13  	RootOrg                   string
    14  	OrgPrefix                 string
    15  	TopLevelProjectID         string
    16  	BslReconcilesInterval     string
    17  	Port                      string
    18  	Mode                      string
    19  	SQL                       SQLConfig
    20  	AccessKey                 *bsl.AccessKey
    21  	Client                    *bsl.Client
    22  	BasicAuthCreds            BslSubscriptionBasicAuth
    23  }
    24  
    25  // Subscription BasicAuth
    26  type BslSubscriptionBasicAuth struct {
    27  	Username string
    28  	Password string
    29  }
    30  
    31  // BSL Onboarding New Org Subscription Payload
    32  type BSLSubscriptionPayload struct {
    33  	TopicID struct {
    34  		Name string `json:"name"`
    35  	} `json:"topicId"`
    36  	CorrelationID string `json:"correlationId"`
    37  	MessageID     string `json:"messageId"`
    38  	ReceiptTimeMs int64  `json:"receiptTimeMs"`
    39  	Attributes    []struct {
    40  		Key   string `json:"key"`
    41  		Value string `json:"value"`
    42  	} `json:"attributes"`
    43  	Payload string `json:"payload"`
    44  }
    45  
    46  // EdgeOrgGroup
    47  type EdgeOrgGroup struct {
    48  	GroupName        string `json:"groupName"`
    49  	GroupDescription string `json:"description,omitempty"`
    50  }
    51  
    52  // EdgeOrgGroupMembership
    53  type EdgeOrgGroupMembership struct {
    54  	GroupName string               `json:"groupName"`
    55  	Members   []EdgeOrgGroupMember `json:"members"`
    56  }
    57  
    58  // EdgeOrgGroupMember
    59  type EdgeOrgGroupMember struct {
    60  	Username string `json:"username"`
    61  }
    62  
    63  // BFFUserRequest
    64  type BFFUserRequest struct {
    65  	Username        string          `json:"username"`
    66  	Email           string          `json:"email"`
    67  	FullName        string          `json:"fullName"`
    68  	GivenName       string          `json:"givenName"`
    69  	FamilyName      string          `json:"familyName"`
    70  	TelephoneNumber string          `json:"telephoneNumber"`
    71  	Status          string          `json:"status"`
    72  	Address         *BFFUserAddress `json:"address"`
    73  }
    74  
    75  type SQLConfig struct {
    76  	ConnectionName string
    77  	User           string
    78  	Password       string
    79  	DatabaseName   string
    80  }
    81  
    82  // BFFUserAddress
    83  type BFFUserAddress struct {
    84  	City       string `json:"city"`
    85  	Country    string `json:"country"`
    86  	PostalCode string `json:"postalCode"`
    87  	State      string `json:"state"`
    88  	Street     string `json:"street"`
    89  }
    90  
    91  // BFFUserPasswordReset
    92  type BFFUserPasswordReset struct {
    93  	Username string `json:"username"`
    94  	Password string `json:"password"`
    95  }
    96  
    97  // EnterpriseType
    98  type EnterpriseType struct {
    99  	Name        string `json:"name"`
   100  	Description string `json:"description"`
   101  }
   102  
   103  // EdgeOrgs
   104  type EdgeOrgs struct {
   105  	LastPage     bool                  `json:"lastPage"`
   106  	PageNumber   int                   `json:"pageNumber"`
   107  	TotalPages   int                   `json:"totalPages"`
   108  	TotalResults int                   `json:"totalResults"`
   109  	PageContent  []EdgeOrgsPageContent `json:"pageContent"`
   110  }
   111  
   112  // AllEdgeOrgs
   113  type AllEdgeOrgs struct {
   114  	PageNumber  int                      `json:"page"`
   115  	PageContent []AllEdgeOrgsPageContent `json:"data"`
   116  }
   117  
   118  // AllEdgeOrgsPageContent
   119  type AllEdgeOrgsPageContent struct {
   120  	DisplayName        string `json:"displayName"`
   121  	ID                 string `json:"id"`
   122  	Parent             bool   `json:"isParent"`
   123  	OrganizationName   string `json:"name"`
   124  	FullyQualifiedName string `json:"fullyQualifiedName"`
   125  }
   126  
   127  // EdgeOrgsPageContent
   128  type EdgeOrgsPageContent struct {
   129  	Username         string `json:"username"`
   130  	FullName         string `json:"fullyQualifiedName"`
   131  	Status           string `json:"status"`
   132  	Primary          bool   `json:"primary"`
   133  	OrganizationName string `json:"name"`
   134  }
   135  
   136  type OrganizationViewData struct {
   137  	ID               string `json:"id"`
   138  	Description      string `json:"description"`
   139  	DisplayName      string `json:"displayName"`
   140  	OrganizationName string `json:"organizationName"`
   141  	Parent           bool   `json:"parent"`
   142  }
   143  
   144  // BSLRoles
   145  type BSLRoles struct { //nolint
   146  	Groups []EdgeOrgGroup `json:"groups"`
   147  	Roles  []BSLRole      `json:"roles"`
   148  }
   149  
   150  // BSLRole
   151  type BSLRole struct { //nolint
   152  	Name string `json:"roleName"`
   153  }
   154  
   155  type GetGroupRolesResponse struct {
   156  	Content []BSLRole `json:"content"`
   157  }
   158  
   159  // UserID contains username `acct:ncr@jsmith` for creating access key.
   160  type UserID struct {
   161  	Username string `json:"username"`
   162  }
   163  
   164  // AccessKeyRequest request for creating access key.
   165  type AccessKeyRequest struct {
   166  	UserID UserID `json:"userId"`
   167  }
   168  
   169  // AccessKeyResponse response for creating an access key for the specified user.
   170  type AccessKeyResponse struct {
   171  	SharedKey             string    `json:"sharedKey"`
   172  	SecretKey             string    `json:"secretKey"`
   173  	UserID                UserID    `json:"userId"`
   174  	Active                bool      `json:"active"`
   175  	CreationTimestamp     time.Time `json:"creationTimestamp"`
   176  	DeactivationTimestamp time.Time `json:"deactivationTimestamp"`
   177  }
   178  
   179  // edgeUser represents the edge user for edge user secret creation.
   180  type edgeUser struct {
   181  	userType   string
   182  	secretName string
   183  	bffUser    bool
   184  }
   185  

View as plain text