Skip to content

Commit

Permalink
Revert "marketplace: add logging for user api (PROJQUAY-233) (quay#2513
Browse files Browse the repository at this point in the history
…)"

This reverts commit b069cf3.
  • Loading branch information
Sunandadadi committed Jan 15, 2024
1 parent 7a93280 commit 51a6956
Show file tree
Hide file tree
Showing 79 changed files with 390 additions and 4,868 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<td colspan="2">
<span class="config-string-field" binding="config.REGISTRY_TITLE"></span>
<div class="help-text" style="margin-top: 10px;">
Name of registry to be displayed in the Contact Page.
Name of registry to be displayed in the Contact Page.
</div>
</td>
</tr>
Expand Down Expand Up @@ -72,7 +72,7 @@
is displayed.
</div>
</td>
</tr>
</tr>
</table>
</div>
</div>
Expand Down Expand Up @@ -215,7 +215,7 @@
</td>
</tr>
</table>
</div>
</div>
</div>


Expand Down Expand Up @@ -459,7 +459,6 @@
<option value="AzureStorage">Azure Blob Storage</option>
<option value="GoogleCloudStorage">Google Cloud Storage</option>
<option value="RadosGWStorage">Ceph Object Gateway (RADOS)</option>
<option value="IBMCloudStorage">IBM Cloud Object Storage</option>
<option value="SwiftStorage">OpenStack Storage (Swift)</option>
<option value="CloudFrontedS3Storage">CloudFront + Amazon S3</option>
<option value="CloudFlareStorage">CloudFlare + Amazon S3</option>
Expand Down Expand Up @@ -746,7 +745,7 @@
<tr>
<td>Security Scanner PSK:</td>
<td>
<span class="config-string-field" binding="config.SECURITY_SCANNER_V4_PSK"
<span class="config-string-field" binding="config.SECURITY_SCANNER_V4_PSK"
is-readonly="fieldGroupReadonly('SecurityScanner')" placeholder="Base64 Encoded PSK"></span>
<div class="help-text" style="margin-top: 10px;">
Clair Pre-Shared Key. Make sure to include this value in your Clair config.
Expand Down Expand Up @@ -1736,7 +1735,7 @@ <h4>Callback URLs for this service:</h4>
<span class="config-list-field" item-title="Super User"
binding="config.SUPER_USERS" item-pattern="[a-z0-9_]{4,30}"></span>
<div class="help-text">
Users included in this list will be given elevated access to Quay.
Users included in this list will be given elevated access to Quay.
</div>
</td>
</tr>
Expand Down Expand Up @@ -1996,14 +1995,14 @@ <h4 class="modal-title">
<span class="cor-loader-inline" ng-show="operatorCommitStatus == 'inProgress'"></span>
<span class="service-title">Committing to Operator</span>
</div>


<!-- Successful commit to operator -->
<div class="service-verification-row" ng-if="operatorCommitStatus == 'success'">
<i class="fa fa-lg fa-check-circle" ng-show="operatorCommitStatus == 'success'"></i>
<span class="service-title">Config Sent to Operator</span>
</div>

<!-- Error in Commit-->
<div class="service-verification-row" ng-if="operatorCommitStatus == 'error'">
<i class="fa fa-lg fa-warning" ng-show="operatorCommitStatus == 'error'"></i>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,6 @@ angular.module("quay-config")
{'name': 'storage_path', 'title': 'Storage Directory', 'placeholder': '/path/inside/bucket', 'kind': 'text'}
],

'IBMCloudStorage': [
{'name': 'hostname', 'title': 'IBM Cloud Storage Hostname', 'placeholder': 'storage hostname', 'kind': 'text'},
{'name': 'port', 'title': 'Custom Port (optional)', 'placeholder': '443', 'kind': 'text', 'pattern': '^[0-9]+$', 'optional': true},
{'name': 'is_secure', 'title': 'Is Secure', 'placeholder': 'Require SSL', 'kind': 'bool'},
{'name': 'access_key', 'title': 'Access Key', 'placeholder': 'accesskeyhere', 'kind': 'text'},
{'name': 'secret_key', 'title': 'Secret Key', 'placeholder': 'secretkeyhere', 'kind': 'text'},
{'name': 'bucket_name', 'title': 'Bucket Name', 'placeholder': 'my-cool-bucket', 'kind': 'text'},
{'name': 'storage_path', 'title': 'Storage Directory', 'placeholder': '/path/inside/bucket', 'kind': 'text'}
],

'SwiftStorage': [
{'name': 'auth_version', 'title': 'Swift Auth Version', 'kind': 'option', 'values': [1, 2, 3]},
{'name': 'auth_url', 'title': 'Swift Auth URL', 'placeholder': 'http://swiftdomain/auth/v1.0', 'kind': 'text'},
Expand Down Expand Up @@ -329,10 +319,10 @@ angular.module("quay-config")
delete $scope.config["DB_CONNECTION_ARGS"]["ssl"];
$scope.config["DB_CONNECTION_ARGS"]["sslrootcert"] = "conf/stack/database.pem";
$scope.config["DB_CONNECTION_ARGS"]["sslmode"] = "verify-full"
} else if
} else if
($scope.certs["database.pem"] && $scope.config["DB_URI"].startsWith("mysql")){
delete $scope.config["DB_CONNECTION_ARGS"]["sslrootcert"];
delete $scope.config["DB_CONNECTION_ARGS"]["sslmode"];
delete $scope.config["DB_CONNECTION_ARGS"]["sslmode"];
$scope.config["DB_CONNECTION_ARGS"]["ssl"] = {}
$scope.config["DB_CONNECTION_ARGS"]["ssl"]["ca"] = "conf/stack/database.pem";
}
Expand Down Expand Up @@ -375,7 +365,7 @@ angular.module("quay-config")
}

$scope.checkValidateAndSave = function() {

if ($scope.configform.$valid) {
saveStorageConfig();
$scope.validateAndSave();
Expand All @@ -385,7 +375,7 @@ angular.module("quay-config")
var query = $.find(".ng-invalid");

console.log(query)
if (query && query.length) {
if (query && query.length) {
query[1].scrollIntoView();
query[1].focus();
}
Expand Down Expand Up @@ -628,7 +618,7 @@ angular.module("quay-config")
$scope.mapped['database'] = {}
$scope.mapped['database'] = parseDbUri(getKey(config, "DB_URI"))
console.log($scope.mapped['database'])

};

var tlsSetter = function(value) {
Expand Down Expand Up @@ -703,7 +693,7 @@ angular.module("quay-config")
}

$scope.config['DB_URI'] = uri

};

var logsModelSelector = function(keyname) {
Expand Down Expand Up @@ -1114,7 +1104,7 @@ angular.module("quay-config")
}
}
$scope.$watch("certs", checkHasFile, true);

$scope.onFileSelect = function(files) {
if (files.length < 1) {
$scope.hasFile = false;
Expand Down Expand Up @@ -1156,9 +1146,9 @@ angular.module("quay-config")
$scope.uploadProgress = null;
});
};



};

}
Expand Down Expand Up @@ -1405,7 +1395,7 @@ angular.module("quay-config")
};
return directiveDefinitionObject;
})

.directive('configStringField', function () {
var directiveDefinitionObject = {
priority: 0,
Expand Down Expand Up @@ -1552,7 +1542,7 @@ angular.module("quay-config")
const c = new X509();
c.readCertPEM(atob(contents));
const current = new Date();
// This function returns a bad string, so we have to do some extra formatting to normalize it.
// This function returns a bad string, so we have to do some extra formatting to normalize it.
let originalDateString = "20"+c.getNotAfter()
let formattedDateString = originalDateString.replace(
/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,
Expand Down Expand Up @@ -1595,7 +1585,7 @@ angular.module("quay-config")
cn.push(attr.value)
}
})
return cn
return cn
}

$scope.deleteCert = function (certPath) {
Expand Down
2 changes: 1 addition & 1 deletion config-tool/pkg/lib/shared/storage_validators.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ func ValidateStorage(opts Options, storageName string, storageType string, args
switch storageType {
case "LocalStorage":
return true, []ValidationError{}
case "RHOCSStorage", "RadosGWStorage", "IBMCloudStorage":
case "RHOCSStorage", "RadosGWStorage":

// Check access key
if ok, err := ValidateRequiredString(args.AccessKey, "DISTRIBUTED_STORAGE_CONFIG."+storageName+".access_key", fgName); !ok {
Expand Down
8 changes: 4 additions & 4 deletions config-tool/pkg/lib/shared/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func (ve ValidationError) String() string {

// DistributedStorageArgs
type DistributedStorageArgs struct {
// Args for RHOCSStorage, RadosGWStorage, IBMCloudStorage
// Args for RHOCSStorage, RadosGWStorage
Hostname string `default:"" validate:"" json:"hostname,omitempty" yaml:"hostname,omitempty"`
Port int `default:"" validate:"" json:"port,omitempty" yaml:"port,omitempty"`
IsSecure bool `default:"" validate:"" json:"is_secure" yaml:"is_secure"`
Expand Down Expand Up @@ -53,7 +53,7 @@ type DistributedStorageArgs struct {
// Args for CloudFlare
CloudflareDomain string `default:"" validate:"" json:"cloudflare_domain,omitempty" yaml:"cloudflare_domain,omitempty"`
// Args for MultiCDNStorage
DefaultProvider string `default:"" validate:"" json:"default_provider,omitempty" yaml:"default_provider,omitempty"`
Providers map[string]interface{} `default:"" validate:"" json:"providers,omitempty" yaml:"providers,omitempty"`
StorageConfig map[string]interface{} `default:"" validate:"" json:"storage_config,omitempty" yaml:"storage_config,omitempty"`
DefaultProvider string `default:"" validate:"" json:"default_provider,omitempty" yaml:"default_provider,omitempty"`
Providers map[string]interface{} `default:"" validate:"" json:"providers,omitempty" yaml:"providers,omitempty"`
StorageConfig map[string]interface{} `default:"" validate:"" json:"storage_config,omitempty" yaml:"storage_config,omitempty"`
}
7 changes: 1 addition & 6 deletions config.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ def frontend_visible_config(config_dict):

# Configuration that should not be changed by end users
class ImmutableConfig(object):

# Requests based HTTP client with a large request pool
HTTPCLIENT = build_requests_session()

Expand Down Expand Up @@ -820,9 +821,6 @@ def create_transaction(db):
# Feature Flag: Enables repository settings in the beta UI Environment
FEATURE_UI_V2_REPO_SETTINGS = False

# Feature Flag: Enables repository builds in the beta UI Environment
FEATURE_UI_V2_BUILDS = False

# User feedback form for UI-V2
UI_V2_FEEDBACK_FORM = "https://7qdvkuo9rkj.typeform.com/to/XH5YE79P"

Expand Down Expand Up @@ -863,6 +861,3 @@ def create_transaction(db):

FEATURE_UI_DELAY_AFTER_WRITE = False
UI_DELAY_AFTER_WRITE_SECONDS = 3

# whitelist for ROBOTS_DISALLOW to grant access/usage for mirroring
ROBOTS_WHITELIST: Optional[List[str]] = []
45 changes: 1 addition & 44 deletions data/billing.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import random
import string
import sys
from calendar import timegm
from datetime import datetime, timedelta
from typing import Any, Dict
Expand Down Expand Up @@ -224,7 +223,6 @@
"privateRepos": 5,
"stripeId": "personal-2018",
"rh_sku": "MW00584MO",
"sku_billing": False,
"audience": "Individuals",
"bus_features": False,
"deprecated": False,
Expand All @@ -237,7 +235,6 @@
"price": 3000,
"privateRepos": 10,
"rh_sku": "MW00585MO",
"sku_billing": False,
"stripeId": "bus-micro-2018",
"audience": "For startups",
"bus_features": True,
Expand All @@ -251,7 +248,6 @@
"price": 6000,
"privateRepos": 20,
"rh_sku": "MW00586MO",
"sku_billing": False,
"stripeId": "bus-small-2018",
"audience": "For small businesses",
"bus_features": True,
Expand All @@ -265,7 +261,6 @@
"price": 12500,
"privateRepos": 50,
"rh_sku": "MW00587MO",
"sku_billing": False,
"stripeId": "bus-medium-2018",
"audience": "For normal businesses",
"bus_features": True,
Expand All @@ -279,7 +274,6 @@
"price": 25000,
"privateRepos": 125,
"rh_sku": "MW00588MO",
"sku_billing": False,
"stripeId": "bus-large-2018",
"audience": "For large businesses",
"bus_features": True,
Expand All @@ -293,7 +287,6 @@
"price": 45000,
"privateRepos": 250,
"rh_sku": "MW00589MO",
"billing_enabled": False,
"stripeId": "bus-xlarge-2018",
"audience": "For extra large businesses",
"bus_features": True,
Expand All @@ -307,7 +300,6 @@
"price": 85000,
"privateRepos": 500,
"rh_sku": "MW00590MO",
"billing_enabled": False,
"stripeId": "bus-500-2018",
"audience": "For huge business",
"bus_features": True,
Expand All @@ -321,7 +313,6 @@
"price": 160000,
"privateRepos": 1000,
"rh_sku": "MW00591MO",
"sku_billing": False,
"stripeId": "bus-1000-2018",
"audience": "For the SaaS savvy enterprise",
"bus_features": True,
Expand All @@ -335,7 +326,6 @@
"price": 310000,
"privateRepos": 2000,
"rh_sku": "MW00592MO",
"sku_billing": False,
"stripeId": "bus-2000-2018",
"audience": "For the SaaS savvy big enterprise",
"bus_features": True,
Expand All @@ -356,33 +346,9 @@
"superseded_by": None,
"plans_page_hidden": False,
},
{
"title": "premium",
"privateRepos": 100,
"stripeId": "not_a_stripe_plan",
"rh_sku": "MW02701",
"sku_billing": True,
"plans_page_hidden": True,
},
{
"title": "selfsupport",
"privateRepos": sys.maxsize,
"stripeId": "not_a_stripe_plan",
"rh_sku": "MW02702",
"sku_billing": True,
"plans_page_hidden": True,
},
]

RH_SKUS = [
plan["rh_sku"] for plan in PLANS if plan.get("rh_sku") is not None and plan.get("sku_billing")
]

RECONCILER_SKUS = [
plan["rh_sku"]
for plan in PLANS
if plan.get("rh_sku") is not None and not plan.get("sku_billing")
]
RH_SKUS = [plan["rh_sku"] for plan in PLANS if plan.get("rh_sku") is not None]


def get_plan(plan_id):
Expand All @@ -400,8 +366,6 @@ def get_plan_using_rh_sku(sku):
"""
Returns the plan with given sku or None if none.
"""
if sku is None:
return None
for plan in PLANS:
if plan.get("rh_sku") == sku:
return plan
Expand All @@ -411,13 +375,6 @@ def get_plan_using_rh_sku(sku):
class FakeStripe(object):
ACTIVE_CUSTOMERS: Dict[str, Any] = {}

class error(object):
class InvalidRequestException(Exception):
pass

class APIConnectionError(Exception):
pass

class FakeSubscription(AttrDict):
@classmethod
def build(cls, data, customer):
Expand Down
Loading

0 comments on commit 51a6956

Please sign in to comment.