Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
ashera96 committed Nov 2, 2023
1 parent f1d3dfa commit bb5a8c8
Show file tree
Hide file tree
Showing 22 changed files with 188 additions and 603 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ message Application {
string name = 2;
string owner = 3;
map<string, string> attributes = 4;
string timestamp = 5;
}

message SecuritySchemes {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,9 @@ message Subscription {
string uuid = 2;
string organization = 3;
SubscribedAPI subscribedApi = 4;
string timestamp = 5;
}

message SubscribedAPI {
string name = 1;
repeated string versions = 2;
string version = 2;
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ type SubscriptionSpec struct {

// API defines the API associated with the subscription
type API struct {
Name string `json:"name"`
Versions []string `json:"versions"`
Name string `json:"name"`
Version string `json:"version"`
}

// SubscriptionStatus defines the observed state of Subscription
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,11 @@ spec:
properties:
name:
type: string
versions:
items:
type: string
type: array
version:
type: string
required:
- name
- versions
- version
type: object
organization:
type: string
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,4 @@ spec:
organization: carbon.super
api:
name: AppSubTestAPI
versions:
- ^v1$
- ^1.*
version: ^1\.|^v1$
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package cp
import (
"context"
"fmt"
"time"

"github.com/wso2/apk/adapter/pkg/logging"
"github.com/wso2/apk/common-controller/internal/loggers"
Expand Down Expand Up @@ -113,7 +112,6 @@ func marshalApplicationList(applicationList []cpv1alpha2.Application) *subscript
Name: appInternal.Spec.Name,
Owner: appInternal.Spec.Owner,
Attributes: appInternal.Spec.Attributes,
Timestamp: appInternal.CreationTimestamp.Time.Format(time.RFC3339), // TODO(Ashera): check if timestamp is accurate if CR is edited
}
applications = append(applications, app)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ package cp
import (
"context"
"fmt"
"time"

"github.com/wso2/apk/adapter/pkg/discovery/api/wso2/discovery/subscription"
"github.com/wso2/apk/adapter/pkg/logging"
Expand Down Expand Up @@ -110,11 +109,10 @@ func marshalSubscriptionList(subscriptionList []cpv1alpha2.Subscription) *subscr
Uuid: subInternal.Name,
SubStatus: subInternal.Spec.SubscriptionStatus,
Organization: subInternal.Spec.Organization,
Timestamp: subInternal.CreationTimestamp.Time.Format(time.RFC3339),
}
if subInternal.Spec.API.Name != "" && len(subInternal.Spec.API.Versions) > 0 {
if subInternal.Spec.API.Name != "" && subInternal.Spec.API.Version != "" {
subscribedAPI.Name = subInternal.Spec.API.Name
subscribedAPI.Versions = subInternal.Spec.API.Versions
subscribedAPI.Version = subInternal.Spec.API.Version
}
sub.SubscribedApi = subscribedAPI
subscriptions = append(subscriptions, sub)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public class AuthenticationContext {
private String subscriber;
private List<String> throttlingDataList;
private int spikeArrestLimit;
private String subscriberTenantDomain;
private String subscriberOrganization;
private String spikeArrestUnit;
private boolean stopOnQuotaReach;
private String apiPublisher;
Expand All @@ -56,7 +56,7 @@ public AuthenticationContext() {
this.consumerKey = UNKNOWN_VALUE;
this.spikeArrestUnit = "";
this.subscriber = UNKNOWN_VALUE;
this.subscriberTenantDomain = UNKNOWN_VALUE;
this.subscriberOrganization = UNKNOWN_VALUE;
}

public List<String> getThrottlingDataList() {
Expand Down Expand Up @@ -227,12 +227,12 @@ public void setSpikeArrestLimit(int spikeArrestLimit) {
*
* @return Subscriber Tenant Domain
*/
public String getSubscriberTenantDomain() {
return subscriberTenantDomain;
public String getSubscriberOrganization() {
return subscriberOrganization;
}

public void setSubscriberOrganization(String subscriberTenantDomain) {
this.subscriberTenantDomain = subscriberTenantDomain;
public void setSubscriberOrganization(String subscriberOrganization) {
this.subscriberOrganization = subscriberOrganization;
}

/**
Expand Down
Loading

0 comments on commit bb5a8c8

Please sign in to comment.