Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added user json as createdBy field in getLicense #89

Merged
merged 2 commits into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ psql -h localhost -p 5432 -U fossy -d fossology

Run the following query to create the first user.
```sql
INSERT INTO users (username, userpassword, userlevel) VALUES ('<username>', '<password>', 'admin');
INSERT INTO users (username, userpassword, userlevel, display_name, user_email) VALUES ('<username>', '<password>', 'SUPER_ADMIN', '<display_name>', '<user_email>');
```

### Generating Swagger Documentation
Expand Down
173 changes: 8 additions & 165 deletions cmd/laas/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -683,75 +683,6 @@ const docTemplate = `{
}
}
}
},
"patch": {
"security": [
{
"ApiKeyAuth": []
}
],
"description": "Update a license in the service",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Licenses"
],
"summary": "Update a license",
"operationId": "UpdateLicense",
"parameters": [
{
"type": "string",
"description": "Shortname of the license to be updated",
"name": "shortname",
"in": "path",
"required": true
},
{
"description": "Update license body (requires only the fields to be updated)",
"name": "license",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/models.LicenseUpdateJSONSchema"
}
}
],
"responses": {
"200": {
"description": "License updated successfully",
"schema": {
"$ref": "#/definitions/models.LicenseResponse"
}
},
"400": {
"description": "Invalid license body",
"schema": {
"$ref": "#/definitions/models.LicenseError"
}
},
"404": {
"description": "License with shortname not found",
"schema": {
"$ref": "#/definitions/models.LicenseError"
}
},
"409": {
"description": "License with same shortname already exists",
"schema": {
"$ref": "#/definitions/models.LicenseError"
}
},
"500": {
"description": "Failed to update license",
"schema": {
"$ref": "#/definitions/models.LicenseError"
}
}
}
}
},
"/login": {
Expand Down Expand Up @@ -2461,6 +2392,14 @@ const docTemplate = `{
"url": {
"type": "string",
"example": "https://opensource.org/licenses/MIT"
},
"user": {
"description": "Reference to User",
"allOf": [
{
"$ref": "#/definitions/models.User"
}
]
}
}
},
Expand Down Expand Up @@ -2492,10 +2431,6 @@ const docTemplate = `{
"models.LicenseId": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 31
},
"shortname": {
"type": "string",
"example": "MIT"
Expand Down Expand Up @@ -2590,98 +2525,6 @@ const docTemplate = `{
}
}
},
"models.LicenseUpdateJSONSchema": {
"type": "object",
"properties": {
"FSFfree": {
"type": "boolean",
"example": false
},
"Fedora": {
"type": "string",
"example": "Fedora"
},
"GPLv2compatible": {
"type": "boolean",
"example": false
},
"GPLv3compatible": {
"type": "boolean",
"example": false
},
"OSIapproved": {
"type": "boolean",
"example": false
},
"active": {
"type": "boolean",
"example": true
},
"copyleft": {
"type": "boolean",
"example": false
},
"detector_type": {
"type": "integer",
"maximum": 2,
"minimum": 0,
"example": 1
},
"external_ref": {
"$ref": "#/definitions/datatypes.JSONType-models_LicenseDBSchemaExtension"
},
"flag": {
"type": "integer",
"maximum": 2,
"minimum": 0,
"example": 1
},
"fullname": {
"type": "string",
"example": "MIT License"
},
"marydone": {
"type": "boolean",
"example": false
},
"notes": {
"type": "string",
"example": "This license has been superseded."
},
"obligations": {
"type": "array",
"items": {
"$ref": "#/definitions/models.Obligation"
}
},
"risk": {
"type": "integer",
"maximum": 5,
"minimum": 0,
"example": 1
},
"source": {
"type": "string",
"example": "Source"
},
"spdx_id": {
"type": "string",
"example": "MIT"
},
"text": {
"type": "string",
"example": "MIT License Text here"
},
"text_updatable": {
"type": "boolean",
"example": false
},
"url": {
"type": "string",
"example": "https://opensource.org/licenses/MIT"
}
}
},
"models.Obligation": {
"type": "object",
"properties": {
Expand Down
Loading