Skip to content

Commit 6a2289d

Browse files
authored
Enable multiple catalogs (#3) (#4)
1 parent 44d6d2c commit 6a2289d

55 files changed

Lines changed: 2004 additions & 138 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ bin/
1717
!**/src/main/**/bin/
1818
!**/src/test/**/bin/
1919

20+
### secrets skip for token generation ###
21+
/openshift/*.key
22+
/openshift/*.p12
23+
2024
### IntelliJ IDEA ###
2125
.idea
2226
*.iws
@@ -41,3 +45,4 @@ out/
4145

4246
# Exclude executable JAR file from gradle build
4347
/docker/app.jar
48+

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,3 +91,11 @@ To do that:
9191

9292
**TODO** link to the documentation for the required directory structure and Catalog(Item).yaml specifications
9393

94+
# Security and local development
95+
In order to get access to the different bickbucket repositories, the local development environment needs to be configured with the required credentials. Those credentials will be part of the request, as a token.
96+
97+
To get the token for the local development, feel free to get security token from any page where azure SSO is required. (you can also execute the script below in your browser console)
98+
```javascript
99+
javascript:(function(){let value=JSON.parse(localStorage[Object.keys(localStorage).find(key=>key.includes('idtoken'))])['secret'];navigator.clipboard.writeText(value);alert('Token copied to clipboard');})();
100+
```
101+

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ plugins {
2323
id 'jacoco'
2424
id 'maven-publish'
2525
id 'java'
26-
id 'org.springframework.boot' version '3.4.3'
26+
id 'org.springframework.boot' version '3.4.7'
2727
id 'io.spring.dependency-management' version '1.1.7'
2828
id "com.gorylenko.gradle-git-properties" version "2.4.1" // Adds git info on /actuator/info endpoint
2929
}

doc/cc-backend-run-config-01.png

100755100644
File mode changed.

doc/cc-backend-run-config-02.png

100755100644
File mode changed.

doc/cc-backend-run-config-03.png

100755100644
File mode changed.

gradlew

100755100644
File mode changed.

openapi/openapi-componentcatalog-v1.0.0.yaml

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,87 @@ tags:
2929
- name: Files
3030
description: File operations.
3131
paths:
32+
/catalog-descriptors:
33+
get:
34+
tags:
35+
- Catalog-descriptors
36+
summary: List of all available Catalog Descriptors.
37+
description: >
38+
Returns a list of all available Catalog Descriptors.<br/>
39+
operationId: getCatalogDescriptors
40+
responses:
41+
"200":
42+
description: A list of Catalog Descriptors.
43+
content:
44+
application/json:
45+
schema:
46+
type: array
47+
items:
48+
$ref: '#/components/schemas/CatalogDescriptor'
49+
"401":
50+
description: Invalid client token on the request.
51+
content:
52+
application/json:
53+
schema:
54+
$ref: '#/components/schemas/RestErrorMessage'
55+
"403":
56+
description: Insufficient permissions for the client to access the resource.
57+
content:
58+
application/json:
59+
schema:
60+
$ref: '#/components/schemas/RestErrorMessage'
61+
"500":
62+
description: Server error.
63+
content:
64+
application/json:
65+
schema:
66+
$ref: '#/components/schemas/RestErrorMessage'
67+
/catalogs/{id}:
68+
get:
69+
tags:
70+
- Catalogs
71+
summary: Get a catalog by id.
72+
description: >
73+
Returns a valid catalog.
74+
operationId: getCatalog
75+
parameters:
76+
- name: id
77+
in: path
78+
description: id for the Catalog.
79+
required: true
80+
schema:
81+
type: string
82+
responses:
83+
"200":
84+
description: A Single catalog.
85+
content:
86+
application/json:
87+
schema:
88+
$ref: '#/components/schemas/Catalog'
89+
"401":
90+
description: Invalid client token on the request.
91+
content:
92+
application/json:
93+
schema:
94+
$ref: '#/components/schemas/RestErrorMessage'
95+
"403":
96+
description: Insufficient permissions for the client to access the resource.
97+
content:
98+
application/json:
99+
schema:
100+
$ref: '#/components/schemas/RestErrorMessage'
101+
"404":
102+
description: Catalog not found
103+
content:
104+
application/json:
105+
schema:
106+
$ref: '#/components/schemas/RestErrorMessage'
107+
"500":
108+
description: Server error.
109+
content:
110+
application/json:
111+
schema:
112+
$ref: '#/components/schemas/RestErrorMessage'
32113
/catalog-items:
33114
get:
34115
tags:
@@ -274,6 +355,44 @@ components:
274355
scheme: bearer
275356
bearerFormat: JWT
276357
schemas:
358+
Catalog:
359+
properties:
360+
name:
361+
type: string
362+
example: 'catalog-name'
363+
description:
364+
type: string
365+
example: 'A brief description for a catalog'
366+
communityPageId:
367+
type: string
368+
example: 'aSdFam...yCg=='
369+
links:
370+
type: array
371+
items:
372+
$ref: '#/components/schemas/CatalogLink'
373+
tags:
374+
type: array
375+
items:
376+
type: string
377+
example:
378+
- 'tasks'
379+
- 'technologies'
380+
CatalogDescriptor:
381+
properties:
382+
id:
383+
type: string
384+
example: 'aSdFam...yCg=='
385+
slug:
386+
type: string
387+
example: 'aSdFam...yCg=='
388+
CatalogLink:
389+
properties:
390+
url:
391+
type: string
392+
example: 'http://some-link.com'
393+
name:
394+
type: string
395+
example: 'whatever name'
277396
CatalogItem:
278397
properties:
279398
id:
@@ -297,6 +416,9 @@ components:
297416
itemSrc:
298417
type: string
299418
example: 'https://bitbucket.some-company.com/projects/SOMEPROJECT/repos/some-repo/browse/CatalogItem.yaml?at=refs/heads/master'
419+
type:
420+
type: string
421+
example: 'machine-learning-model'
300422
tags:
301423
type: array
302424
items:

scripts/openapi/generate.sh

100755100644
File mode changed.

scripts/openapi/update-bb-api.sh

100755100644
File mode changed.

0 commit comments

Comments
 (0)