Skip to content

Commit

Permalink
fixed issuer
Browse files Browse the repository at this point in the history
  • Loading branch information
George Jahad committed Oct 21, 2024
1 parent 350d286 commit dc4ece1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/lib/clients/vault/oidc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ def get_oidc_client_config
def create_client_config(issuer, client_id, client_secret)
client.logical.write("/sys/auth/oidc", type: "oidc")
client.logical.write("auth/oidc/config",
oidc_discovery_url: issuer,
oidc_discovery_ca_pem: File.read(Config[:oidc_provider_ssl_cert]),
oidc_discovery_url: issuer,
oidc_discovery_ca_pem: File.read(Config[:oidc_provider_ssl_cert]),
oidc_client_id: client_id,
oidc_client_secret: client_secret,
default_role: "default")
Expand Down
2 changes: 1 addition & 1 deletion app/lib/utils/oidc_provider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_info
vault_client.logical.read("identity/oidc/provider/astral")
end

def get_issuer
def self.get_configured_issuer
Config[:oidc_provider_addr] + Config[:oidc_issuer_path]
end

Expand Down
2 changes: 1 addition & 1 deletion config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class Application < Rails::Application
Clients::Vault.configure_kv
Clients::Vault.configure_pki
get_oidc_config
issuer = OidcProvider.new.get_issuer
issuer = OidcProvider.get_configured_issuer
Clients::Vault.configure_as_oidc_client(issuer,
config.astral.oidc_client_id,
config.astral.oidc_client_secret)
Expand Down
4 changes: 2 additions & 2 deletions test/lib/clients/oidc_provider_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class OidcProviderTest < ActiveSupport::TestCase
assert_equal "email", @info.data[:scopes_supported][0]
end

test ".get_issuer returns correct issuer" do
issuer = @provider.get_issuer
test "#get_issuer returns correct issuer" do
issuer = OidcProvider.get_configured_issuer
assert_equal @info.data[:issuer], issuer
end

Expand Down

0 comments on commit dc4ece1

Please sign in to comment.