Skip to content

Commit

Permalink
feat: added user/createdBy when creating new license
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourav Bhowmik authored and deo002 committed Feb 19, 2025
1 parent 965fa5a commit 38e14e0
Show file tree
Hide file tree
Showing 10 changed files with 431 additions and 840 deletions.
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
165 changes: 0 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 @@ -2500,10 +2431,6 @@ const docTemplate = `{
"models.LicenseId": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 31
},
"shortname": {
"type": "string",
"example": "MIT"
Expand Down Expand Up @@ -2598,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
165 changes: 0 additions & 165 deletions cmd/laas/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -676,75 +676,6 @@
}
}
}
},
"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 @@ -2493,10 +2424,6 @@
"models.LicenseId": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"example": 31
},
"shortname": {
"type": "string",
"example": "MIT"
Expand Down Expand Up @@ -2591,98 +2518,6 @@
}
}
},
"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

0 comments on commit 38e14e0

Please sign in to comment.