Demonstrate authentication as DFC client app

This commit is contained in:
Maikel Linke
2025-08-07 13:51:43 +10:00
parent 9be27842e1
commit c12d494de3
3 changed files with 22 additions and 0 deletions

View File

@@ -17,4 +17,8 @@ class ApiUser
def initialize(id)
@id = id
end
def enterprises
Enterprise.none
end
end

View File

@@ -3,6 +3,7 @@
require_relative "../swagger_helper"
RSpec.describe "CatalogItems", swagger_doc: "dfc.yaml" do
let(:Authorization) { nil }
let(:user) { create(:oidc_user, id: 12_345) }
let(:enterprise) {
create(
@@ -35,8 +36,23 @@ RSpec.describe "CatalogItems", swagger_doc: "dfc.yaml" do
get "List CatalogItems" do
produces "application/json"
security [oidc_token: []]
response "404", "not found" do
context "as platform user" do
let(:enterprise_id) { 10_000 }
let(:sib_token) { file_fixture("startinblox_access_token.jwt").read }
let(:Authorization) { "Bearer #{sib_token}" }
before { login_as nil }
around do |example|
Timecop.travel(Date.parse("2025-06-13")) { example.run }
end
run_test!
end
context "without enterprises" do
let(:enterprise_id) { "default" }

View File

@@ -137,6 +137,8 @@ paths:
type: string
get:
summary: List CatalogItems
security:
- oidc_token: []
tags:
- CatalogItems
responses: