Merge branch 'master' into 2334-remove-que

This commit is contained in:
Thiago Youssef 2022-09-28 07:40:02 -03:00
commit a6a3f72032
240 changed files with 5827 additions and 1432 deletions

View file

@ -235,3 +235,11 @@ registry_demo_accredited_users_url: 'http://registry.test/api/v1/accreditation_c
a_and_aaaa_validation_timeout: '1'
nameserver_validation_timeout: '1'
eis_billing_system_base_url: 'http://eis_billing_system:3000'
billing_secret: acd50ed44524d24c826d724fda922b790ca4130b02d62bcc8f85f1b863195ba8d155c4346037364eb59135d1e9dcba6cd8a4046ee4aef3c3a0878fcdf8e85efd
billing_system_integrated: 'true'
secret_access_word: 'please-Give-Me-accesS'
secret_word: 'this-secret-should-be-change'
allow_accr_endspoints: 'true'

View file

@ -0,0 +1 @@
bXY8qqnyzpMtyIDA74p4C1GiW+cLO7yeUXl5nwZB7yy1Lkv0XbF8juV07MCm7mBgh0BfjK9Ey2sx+QiXH/PimvhNDtgy6vSNbgb5AcQBJ6XwHlXei/DNF7Bt+r5V+ixrDU6FJZ8Y9EQyjZC9zcPiAaMhDMmA71bfiE2vO2TT1T6BZcjD5P4GKmYM7pMDgKATrwauzd6ejuYfTpSBHR51zuUEEBL1uZKSXW/i6vNAE+yuRxNOULWISA0zDPaCipnrMwjf8yWkp9L4qLIcggYpepZm6t+OyAD2XMTz/5skfQRtZ0PGDs7gzJLdAYD6ErUTU9N+n6SPhPpWu0zPFMR/A9t6AudgupmLeADGnkzUyRa4jCLzOnklV4rzAT1vM4zdVhGCgd3JXQL6zptrgHgRQN8i3BhBY2w3KXtFV1N61M6cMuuvTHMMFVI+V9sbRJ58Nok9EVbu5U/WRpuJElKq7xo1bgtY/0NOFq2K+TqZT6RBtSH5sWIdUGJJIbI6VngzfZpUNPiyg9eyShK2Wa2v1BlyLK3zYRD8F9/kNUvLCX7vgSjI/pwifokVAF51GhykhlmpfOyLmEEc011DwD+F4xjkYN1xHY8=--YBWnRjhG+BqNrfar--RcZCpjUq+MNhMOydjZWWTA==

View file

@ -0,0 +1,25 @@
require 'arel/nodes/binary'
require 'arel/predications'
require 'arel/visitors/postgresql'
module Arel
class Nodes::ContainsArray < Arel::Nodes::Binary
def operator
:"@>"
end
end
class Visitors::PostgreSQL
private
def visit_Arel_Nodes_ContainsArray(o, collector)
infix_value o, collector, ' @> '
end
end
module Predications
def contains_array(other)
Nodes::ContainsArray.new self, Nodes.build_quoted(other, self)
end
end
end

View file

@ -15,62 +15,67 @@ host = ENV['tara_host']
identifier = ENV['tara_identifier']
secret = ENV['tara_secret']
redirect_uri = ENV['tara_redirect_uri']
authorization_endpoint = ENV['tara_authorization_endpoint']
token_endpoint = ENV['tara_token_endpoint']
jwks_uri = ENV['tara_jwks_uri']
scope = ENV['tara_scope']
registrant_identifier = ENV['tara_rant_identifier']
registrant_secret = ENV['tara_rant_secret']
registrant_redirect_uri = ENV['tara_rant_redirect_uri']
Rails.application.config.middleware.use OmniAuth::Builder do
provider "tara", {
callback_path: '/registrar/open_id/callback',
name: 'tara',
scope: ['openid'],
state: Proc.new{ SecureRandom.hex(10) },
client_signing_alg: :RS256,
client_jwk_signing_key: signing_keys,
send_scope_to_token_endpoint: false,
send_nonce: true,
issuer: issuer,
provider 'tara', {
callback_path: '/registrar/open_id/callback',
name: 'tara',
scope: scope,
# state: Proc.new{ SecureRandom.hex(10) },
client_signing_alg: :RS256,
client_jwk_signing_key: signing_keys,
send_scope_to_token_endpoint: false,
send_nonce: true,
issuer: issuer,
discovery: true,
client_options: {
scheme: 'https',
host: host,
client_options: {
scheme: 'https',
host: host,
authorization_endpoint: '/oidc/authorize',
token_endpoint: '/oidc/token',
userinfo_endpoint: nil, # Not implemented
jwks_uri: '/oidc/jwks',
authorization_endpoint: authorization_endpoint,
token_endpoint: token_endpoint,
userinfo_endpoint: nil, # Not implemented
jwks_uri: jwks_uri,
# Registry
identifier: identifier,
secret: secret,
redirect_uri: redirect_uri,
},
# Registry
identifier: identifier,
secret: secret,
redirect_uri: redirect_uri,
},
}
provider "tara", {
callback_path: '/registrant/open_id/callback',
name: 'rant_tara',
scope: ['openid'],
client_signing_alg: :RS256,
client_jwk_signing_key: signing_keys,
send_scope_to_token_endpoint: false,
send_nonce: true,
issuer: issuer,
provider 'tara', {
callback_path: '/registrant/open_id/callback',
name: 'rant_tara',
scope: ['openid'],
client_signing_alg: :RS256,
client_jwk_signing_key: signing_keys,
send_scope_to_token_endpoint: false,
send_nonce: true,
issuer: issuer,
client_options: {
scheme: 'https',
host: host,
client_options: {
scheme: 'https',
host: host,
authorization_endpoint: '/oidc/authorize',
token_endpoint: '/oidc/token',
userinfo_endpoint: nil, # Not implemented
jwks_uri: '/oidc/jwks',
authorization_endpoint: '/oidc/authorize',
token_endpoint: '/oidc/token',
userinfo_endpoint: nil, # Not implemented
jwks_uri: '/oidc/jwks',
# Registry
identifier: registrant_identifier,
secret: registrant_secret,
redirect_uri: registrant_redirect_uri,
},
# Registry
identifier: registrant_identifier,
secret: registrant_secret,
redirect_uri: registrant_redirect_uri,
},
}
end

View file

@ -0,0 +1,7 @@
Ransack.configure do |config|
config.add_predicate 'contains_array',
arel_predicate: 'contains_array',
formatter: proc { |v| "{#{v}}" },
validator: proc { |v| v.present? },
type: :string
end

View file

@ -8,8 +8,11 @@ en:
date_long: "%d. %B %Y"
filename: "%Y-%m-%d_%H.%M"
date:
month_names:
[~, January, February, March, April, May, June, July, August, September, October, November, December]
formats:
default: "%Y-%m-%d"
month_year: "%B, %Y"
activerecord:
errors:
@ -96,13 +99,16 @@ en:
contact:
blank: 'Contact was not found'
taken: 'Contact already exists on this domain'
contact_code_cache:
taken: 'Contact already exists on this domain'
domain_status:
attributes:
value:
taken: 'Status already exists on this domain'
invoice:
attributes:
base:
invoice_status_prohibits_operation: 'Invoice status prohibits operation'
user:
attributes:
@ -189,6 +195,7 @@ en:
log_out: 'Log out (%{user})'
system: 'System'
domains: 'Domains'
auctions: 'Auctions'
registrars: 'Registrars'
valid_to: 'Valid to'
name: 'Name'
@ -371,7 +378,7 @@ en:
sim_error: 'SIM application error'
internal_error: 'Internal error'
client_side_status_editing_error: 'Parameter value policy error. Client-side object status management not supported'
parameter_value_syntax_error: 'Parameter value syntax error: '
parameter_value_syntax_error: 'Parameter value syntax error:'
# DEPP
activemodel:
@ -480,6 +487,8 @@ en:
invoice:
title: 'Invoice'
already_paid: " (already paid)"
monthly_invoice: " (monthly invoice)"
monthly_invoice_description: 'Monthly invoice'
bank_statements: 'Bank statements'
back_to_bank_statements: 'Back to bank statements'
back_to_bank_statement: 'Back to bank statement'
@ -627,7 +636,7 @@ en:
contact_ident: 'Contact ident'
results_per_page: 'Results per page'
nameserver_hostname: 'Nameserver hostname'
result_count:
result_count:
zero: 'No results'
other: '%{count} results'
one: '1 result'

View file

@ -3,9 +3,14 @@ et:
password: 'Parool'
date:
# Don't forget the nil at the beginning; there's no such thing as a 0th month
month_names: [~, Jaanuar, Veebruar, Märts, Aprill, Mai, Juuni, Juuli, August, September, Oktoober, November, Detsember]
month_names:
[~, Jaanuar, Veebruar, Märts, April, Mai, Juuni, Juuli, August, September, Oktoober, November, Detsember]
formats:
default: "%Y-%m-%d"
month_year: "%B, %Y"
emails: "Meillaadressid"
invoice:
title: 'Arve'
already_paid: " (juba makstud)"
monthly_invoice: " (kuuaruanne)"
monthly_invoice_description: 'Kuuaruanne'

View file

@ -1,6 +1,8 @@
en:
registrar:
domains:
email_error_message: 'Check contacts emails'
index:
header: Domains
new_btn: New domain

View file

@ -11,6 +11,13 @@ Rails.application.routes.draw do
mount PgHero::Engine, at: "pghero"
end
namespace :eis_billing do
put '/payment_status', to: 'payment_status#update', as: 'payment_status', :format => false, :defaults => { :format => 'json' }
put '/directo_response', to: 'directo_response#update', as: 'directo_response'
put '/e_invoice_response', to: 'e_invoice_response#update', as: 'e_invoice_response'
post '/lhv_connect_transactions', to: 'lhv_connect_transactions#create', as: 'lhv_connect_transactions'
end
namespace :epp do
constraints(EppConstraint.new(:session)) do
get 'session/hello', to: 'sessions#hello', as: 'hello'
@ -64,16 +71,40 @@ Rails.application.routes.draw do
resources :contacts do
collection do
get 'check/:id', to: 'contacts#check'
get 'search(/:id)', to: 'contacts#search'
end
end
resources :accounts do
resource :accounts, only: %i[index update] do
collection do
get '/', to: 'accounts#index'
get 'balance'
get 'details'
post 'update_auto_reload_balance'
get 'disable_auto_reload_balance'
end
member do
put 'switch_user'
end
end
resources :invoices, only: %i[index show] do
collection do
get ':id/download', to: 'invoices#download'
post 'add_credit'
end
member do
post 'send_to_recipient', to: 'invoices#send_to_recipient'
put 'cancel', to: 'invoices#cancel'
end
end
resources :auctions, only: %i[index]
resources :retained_domains, only: %i[index]
resources :stats do
collection do
get '/market_share_distribution', to: 'stats#market_share_distribution'
get '/market_share_growth_rate', to: 'stats#market_share_growth_rate'
end
end
namespace :registrar do
resources :notifications, only: [:index, :show, :update] do
collection do
@ -91,6 +122,12 @@ Rails.application.routes.draw do
put '/', to: 'nameservers#update'
end
end
resources :summary, only: %i[index]
resources :auth, only: %i[index] do
collection do
post '/tara_callback', to: 'auth#tara_callback'
end
end
end
resources :domains, constraints: { id: /.*/ } do
resources :nameservers, only: %i[index create destroy], constraints: { id: /.*/ }, controller: 'domains/nameservers'
@ -139,9 +176,9 @@ Rails.application.routes.draw do
namespace :accreditation_center do
# At the moment invoice_status endpoint returns only cancelled invoices. But in future logic of this enpoint can change.
# And it will need to return invoices of different statuses. I decided to leave the name of the endpoint "invoice_status"
resources :invoice_status, only: [ :index ]
resource :domains, only: [ :show ], param: :name
resource :contacts, only: [ :show ], param: :id
resources :invoice_status, only: [:index]
resource :domains, only: [:show], param: :name
resource :contacts, only: [:show], param: :id
# resource :auth, only: [ :index ]
get 'auth', to: 'auth#index'
end
@ -152,7 +189,7 @@ Rails.application.routes.draw do
end
match '*all', controller: 'cors', action: 'cors_preflight_check', via: [:options],
as: 'cors_preflight_check'
as: 'cors_preflight_check'
end
# REGISTRAR ROUTES
@ -266,6 +303,13 @@ Rails.application.routes.draw do
resources :accounts
resources :account_activities
resources :auctions, only: [ :index, :create ] do
collection do
post 'upload_spreadsheet', to: 'auctions#upload_spreadsheet', as: :upload_spreadsheet
end
end
# post 'admi/upload_spreadsheet', to: 'customers#upload_spreadsheet', as: :customers_upload_spreadsheet
resources :bank_statements do
resources :bank_transactions
@ -335,6 +379,10 @@ Rails.application.routes.draw do
member do
get 'delete'
end
collection do
post 'release_to_auction', to: 'reserved_domains#release_to_auction', as: 'release_to_auction'
end
end
resources :disputes do
member do