Skip to content

Commit e0f7541

Browse files
committed
Merge branch 'LG-17009-log-oid-orgs' into 'main'
LG-17009: Log Service provider for user See merge request lg/identity-pki!109
2 parents d970d9a + 232f568 commit e0f7541

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

app/controllers/identify_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ def allowed_referrer?(uri)
100100
!allowed_host || uri.host == allowed_host
101101
end
102102

103+
def current_sp
104+
params[:current_sp].present? ? params[:current_sp] : 'None'
105+
end
106+
103107
def log_certificate(cert)
104108
validation_result = cert.validate_cert(is_leaf: true)
105109
valid = validation_result == 'valid'
@@ -109,6 +113,7 @@ def log_certificate(cert)
109113
key_id: cert.key_id,
110114
certificate_chain_signing_key_ids: cert.x509_certificate_chain_key_ids,
111115
issuer: cert.issuer.to_s,
116+
current_sp: current_sp,
112117
valid_policies: cert.valid_policies?,
113118
mapped_policy_oids: cert.mapped_policies.map { |oid| [oid, true] }.to_h,
114119
valid: valid,

spec/controllers/identify_controller_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@
150150
key_id: cert.key_id,
151151
certificate_chain_signing_key_ids: [cert.signing_key_id],
152152
issuer: cert.issuer.to_s,
153+
current_sp: 'None',
153154
valid_policies: true,
154155
mapped_policy_oids: { '2.16.840.1.101.3.2.1.3.7' => true },
155156
valid: true,
@@ -362,6 +363,7 @@
362363
signing_key_id: cert.key_id,
363364
key_id: cert.key_id,
364365
certificate_chain_signing_key_ids: [cert.signing_key_id],
366+
current_sp: 'None',
365367
valid_policies: false,
366368
mapped_policy_oids: {},
367369
valid: false,

0 commit comments

Comments
 (0)