# 4EVER Security Token Service API

## Introduction

The 4EVERLAND Security Token Service is a service designed to generate temporary credentials, allowing you to request temporary credentials for partial or even full privileges for other users or a specified user.

4EVER Bucket STS fully compatible with AWS S3 STS. More information about STS can be found at [AWS S3 STS](https://docs.aws.amazon.com/STS/latest/APIReference/welcome.html).

## How to use

This is obtained by taking the API Secret and the API Key from the Master key and sending them to the endpoint. By default, all 4EVERLAND STS requests are sent to `https://endpoint.4everland.co.`

Javascript example:

```javascript
const {STSClient, AssumeRoleCommand} = require('@aws-sdk/client-sts')

const stsClient = new STSClient({
    endpoint: 'https://endpoint.4everland.co',
    region: 'us-west-1',
    credentials: {
        accessKeyId: 'Your api key.',
        secretAccessKey:  'Your api secret.',
    }
});

const params = {
    RoleSessionName: "only-put-object",
    DurationSeconds: 3600,
    Policy: `{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:AbortMultipartUpload"
            ],
            "Resource": [
                "arn:aws:s3:::your-bucket-name/your-directory/*"
            ]
        }
    ]
}`
};


stsClient.send(new AssumeRoleCommand(params)).then(function (data) {
    console.log(data.Credentials)
});
```

## How to get the Master Key

Click on Bucket> Access key> Master-Key

<figure><img src="/files/8nhcY977kzPJnn74nGXd" alt=""><figcaption></figcaption></figure>

Copy API Key and API Secret

<figure><img src="/files/U93VvN93wPs9mqxcoeNe" alt=""><figcaption></figcaption></figure>

{% hint style="warning" %}
The API Secret can be reset if there is a security breach, the Master key cannot be deleted.
{% endhint %}

{% hint style="info" %}
If you have any questions, please join our [Discord server](https://discord.com/invite/Cun2VpsdjF), or send us an email at <contact@4everland.org>.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.4everland.org/storage/bucket/4ever-security-token-service-api.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
