|
| 1 | +--- |
| 2 | +# generated by https://github.com/hashicorp/terraform-plugin-docs |
| 3 | +page_title: "forgejo_personal_access_token Resource - forgejo" |
| 4 | +subcategory: "" |
| 5 | +description: |- |
| 6 | + Forgejo personal access token resource. |
| 7 | + Note: Due to an upstream limitation, one cannot create access tokens when authorized with access tokens. Use basic-auth instead. |
| 8 | +--- |
| 9 | + |
| 10 | +# forgejo_personal_access_token (Resource) |
| 11 | + |
| 12 | +Forgejo personal access token resource. |
| 13 | + |
| 14 | +**Note**: Due to an upstream limitation, one cannot create access tokens when authorized with access tokens. Use basic-auth instead. |
| 15 | + |
| 16 | +## Example Usage |
| 17 | + |
| 18 | +```terraform |
| 19 | +terraform { |
| 20 | + required_providers { |
| 21 | + forgejo = { |
| 22 | + source = "svalabs/forgejo" |
| 23 | + } |
| 24 | + } |
| 25 | +} |
| 26 | +
|
| 27 | +variable "test_password" { sensitive = true } |
| 28 | +
|
| 29 | +provider "forgejo" { |
| 30 | + host = "http://localhost:3000" |
| 31 | + // Due to an upstream limitation, one cannot create access tokens when authorized with an access token. |
| 32 | + // Use basic-auth instead (FORGEJO_USERNAME / FORGEJO_PASSWORD environment variables). |
| 33 | +} |
| 34 | +
|
| 35 | +resource "forgejo_user" "test_user" { |
| 36 | + login = "test_user" |
| 37 | + email = "test_user@localhost.localdomain" |
| 38 | + password = var.test_password |
| 39 | +} |
| 40 | +
|
| 41 | +resource "forgejo_personal_access_token" "test_token" { |
| 42 | + user = forgejo_user.test_user.login |
| 43 | + name = "test token" |
| 44 | + scopes = [ |
| 45 | + "read:repository" |
| 46 | + ] |
| 47 | +} |
| 48 | +``` |
| 49 | + |
| 50 | +<!-- schema generated by tfplugindocs --> |
| 51 | +## Schema |
| 52 | + |
| 53 | +### Required |
| 54 | + |
| 55 | +- `name` (String) Name of the personal access token. Changing this forces a new resource to be created. |
| 56 | +- `scopes` (Set of String) Scopes of the personal access token. Changing this forces a new resource to be created. |
| 57 | +- `user` (String) Name of the user. Changing this forces a new resource to be created. |
| 58 | + |
| 59 | +### Read-Only |
| 60 | + |
| 61 | +- `id` (Number) Numeric identifier of the personal access token. |
| 62 | +- `token` (String, Sensitive) The personal access token. |
| 63 | +- `token_last_eight` (String) Last eight characters of the personal access token. |
0 commit comments