mirror of
https://github.com/minio/docs.git
synced 2025-07-02 05:02:40 +03:00
Docs Multiplatform Slice
This commit is contained in:
2853
source/developers/dotnet/API.md
Normal file
2853
source/developers/dotnet/API.md
Normal file
File diff suppressed because it is too large
Load Diff
20
source/developers/dotnet/minio-dotnet.rst
Normal file
20
source/developers/dotnet/minio-dotnet.rst
Normal file
@ -0,0 +1,20 @@
|
||||
.. _minio-dotnet-quickstart:
|
||||
|
||||
=====================
|
||||
.NET Quickstart Guide
|
||||
=====================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
.. include:: /developers/dotnet/quickstart.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
/developers/dotnet/API.md
|
212
source/developers/dotnet/quickstart.md
Normal file
212
source/developers/dotnet/quickstart.md
Normal file
@ -0,0 +1,212 @@
|
||||
# MinIO Client SDK for .NET [](https://slack.min.io)
|
||||
|
||||
MinIO Client SDK provides higher level APIs for MinIO and Amazon S3 compatible cloud storage services.For a complete list of APIs and examples, please take a look at the [Dotnet Client API Reference](https://docs.min.io/docs/dotnet-client-api-reference).This document assumes that you have a working VisualStudio development environment.
|
||||
|
||||
## Minimum Requirements
|
||||
* .NET 5.0
|
||||
* Visual Studio 2017
|
||||
|
||||
## Install from NuGet
|
||||
|
||||
To install [MinIO .NET package](https://www.nuget.org/packages/Minio/), run the following command in Nuget Package Manager Console.
|
||||
```powershell
|
||||
PM> Install-Package Minio
|
||||
```
|
||||
## MinIO Client Example
|
||||
To connect to an Amazon S3 compatible cloud storage service, you will need to specify the following parameters.
|
||||
|
||||
| Parameter | Description|
|
||||
| :--- | :--- |
|
||||
| endpoint | URL to object storage service. |
|
||||
| accessKey | Access key is the user ID that uniquely identifies your account. |
|
||||
| secretKey | Secret key is the password to your account. |
|
||||
| secure | Enable/Disable HTTPS support. |
|
||||
|
||||
The following examples uses a freely hosted public MinIO service 'play.min.io' for development purposes.
|
||||
|
||||
```cs
|
||||
using Minio;
|
||||
|
||||
// Initialize the client with access credentials.
|
||||
private static MinioClient minio = new MinioClient()
|
||||
.WithEndpoint("play.min.io")
|
||||
.WithCredentials("Q3AM3UQ867SPQQA43P2F",
|
||||
"zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
|
||||
.WithSSL()
|
||||
.Build();
|
||||
|
||||
// Create an async task for listing buckets.
|
||||
var getListBucketsTask = minio.ListBucketsAsync();
|
||||
|
||||
// Iterate over the list of buckets.
|
||||
foreach (Bucket bucket in getListBucketsTask.Result.Buckets)
|
||||
{
|
||||
Console.WriteLine(bucket.Name + " " + bucket.CreationDateDateTime);
|
||||
}
|
||||
|
||||
```
|
||||
## Complete _File Uploader_ Example
|
||||
|
||||
This example program connects to an object storage server, creates a bucket and uploads a file to the bucket.
|
||||
To run the following example, click on [Link] and start the project
|
||||
```cs
|
||||
using System;
|
||||
using Minio;
|
||||
using Minio.Exceptions;
|
||||
using Minio.DataModel;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace FileUploader
|
||||
{
|
||||
class FileUpload
|
||||
{
|
||||
static void Main(string[] args)
|
||||
{
|
||||
var endpoint = "play.min.io";
|
||||
var accessKey = "Q3AM3UQ867SPQQA43P2F";
|
||||
var secretKey = "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG";
|
||||
try
|
||||
{
|
||||
var minio = new MinioClient()
|
||||
.WithEndpoint(endpoint)
|
||||
.WithCredentials(accessKey,
|
||||
secretKey)
|
||||
.WithSSL()
|
||||
.Build();
|
||||
FileUpload.Run(minio).Wait();
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex.Message);
|
||||
}
|
||||
Console.ReadLine();
|
||||
}
|
||||
|
||||
// File uploader task.
|
||||
private async static Task Run(MinioClient minio)
|
||||
{
|
||||
var bucketName = "mymusic";
|
||||
var location = "us-east-1";
|
||||
var objectName = "golden-oldies.zip";
|
||||
var filePath = "C:\\Users\\username\\Downloads\\golden_oldies.mp3";
|
||||
var contentType = "application/zip";
|
||||
|
||||
try
|
||||
{
|
||||
// Make a bucket on the server, if not already present.
|
||||
bool found = await minio.BucketExistsAsync(bucketName);
|
||||
if (!found)
|
||||
{
|
||||
await minio.MakeBucketAsync(bucketName, location);
|
||||
}
|
||||
// Upload a file to bucket.
|
||||
await minio.PutObjectAsync(bucketName, objectName, filePath, contentType);
|
||||
Console.WriteLine("Successfully uploaded " + objectName );
|
||||
}
|
||||
catch (MinioException e)
|
||||
{
|
||||
Console.WriteLine("File Upload Error: {0}", e.Message);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Running MinIO Client Examples
|
||||
#### On Windows
|
||||
* Clone this repository and open the Minio.Sln in Visual Studio 2017.
|
||||
|
||||
* Enter your credentials and bucket name, object name etc.in Minio.Examples/Program.cs
|
||||
Uncomment the example test cases such as below in Program.cs to run an example.
|
||||
```cs
|
||||
//Cases.MakeBucket.Run(minioClient, bucketName).Wait();
|
||||
```
|
||||
* Run the Minio.Client.Examples project from Visual Studio
|
||||
#### On Linux
|
||||
|
||||
##### Setting .NET SDK on Linux (Ubuntu 21.10)
|
||||
<blockquote> NOTE: minio-dotnet requires .NET 5.x SDK to build on Linux. </blockquote>
|
||||
|
||||
* Install [.Net SDK](https://docs.microsoft.com/en-us/dotnet/core/install/linux?WT.mc_id=dotnet-35129-website)
|
||||
|
||||
```
|
||||
wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
|
||||
sudo dpkg -i packages-microsoft-prod.deb
|
||||
rm packages-microsoft-prod.deb
|
||||
```
|
||||
|
||||
```
|
||||
sudo apt-get update; \
|
||||
sudo apt-get install -y apt-transport-https && \
|
||||
sudo apt-get update && \
|
||||
sudo apt-get install -y dotnet-sdk-5.0
|
||||
```
|
||||
|
||||
##### Running Minio.Examples
|
||||
* Clone this project.
|
||||
|
||||
```
|
||||
$ git clone https://github.com/minio/minio-dotnet && cd minio-dotnet
|
||||
```
|
||||
|
||||
* Enter your credentials and bucket name, object name etc. in Minio.Examples/Program.cs
|
||||
Uncomment the example test cases such as below in Program.cs to run an example.
|
||||
```cs
|
||||
//Cases.MakeBucket.Run(minioClient, bucketName).Wait();
|
||||
```
|
||||
|
||||
```
|
||||
dotnet build --configuration Release --no-restore
|
||||
dotnet pack ./Minio/Minio.csproj --no-build --configuration Release --output ./artifacts
|
||||
dotnet test ./Minio.Tests/Minio.Tests.csproj
|
||||
```
|
||||
|
||||
#### Bucket Operations
|
||||
|
||||
* [MakeBucket.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/MakeBucket.cs)
|
||||
* [ListBuckets.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListBuckets.cs)
|
||||
* [BucketExists.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/BucketExists.cs)
|
||||
* [RemoveBucket.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveBucket.cs)
|
||||
* [ListObjects.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListObjects.cs)
|
||||
* [ListIncompleteUploads.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListIncompleteUploads.cs)
|
||||
* [ListenBucketNotifications.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/ListenBucketNotifications.cs)
|
||||
|
||||
#### Bucket policy Operations
|
||||
* [GetPolicy.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/GetBucketPolicy.cs)
|
||||
* [SetPolicy.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/SetBucketPolicy.cs)
|
||||
|
||||
#### Bucket notification Operations
|
||||
* [GetBucketNotification.cs](./Minio.Examples/Cases/GetBucketNotification.cs)
|
||||
* [SetBucketNotification.cs](./Minio.Examples/Cases/SetBucketNotification.cs)
|
||||
* [RemoveAllBucketNotifications.cs](./Minio.Examples/Cases/RemoveAllBucketNotifications.cs)
|
||||
|
||||
#### File Object Operations
|
||||
* [FGetObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/FGetObject.cs)
|
||||
* [FPutObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/FPutObject.cs)
|
||||
|
||||
#### Object Operations
|
||||
* [GetObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/GetObject.cs)
|
||||
* [GetPartialObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/GetPartialObject.cs)
|
||||
* [SelectObjectContent.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/SelectObjectContent.cs)
|
||||
|
||||
* [PutObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PutObject.cs)
|
||||
* [StatObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/StatObject.cs)
|
||||
* [RemoveObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveObject.cs)
|
||||
* [RemoveObjects.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveObjects.cs)
|
||||
* [CopyObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/CopyObject.cs)
|
||||
* [CopyObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/CopyObjectMetadata.cs)
|
||||
* [RemoveIncompleteUpload.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/RemoveIncompleteUpload.cs)
|
||||
|
||||
#### Presigned Operations
|
||||
* [PresignedGetObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PresignedGetObject.cs)
|
||||
* [PresignedPutObject.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PresignedPutObject.cs)
|
||||
* [PresignedPostPolicy.cs](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Cases/PresignedPostPolicy.cs)
|
||||
|
||||
#### Client Custom Settings
|
||||
* [SetAppInfo](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Program.cs)
|
||||
* [SetTraceOn](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Program.cs)
|
||||
* [SetTraceOff](https://github.com/minio/minio-dotnet/blob/master/Minio.Examples/Program.cs)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [MinIO .NET SDK API Reference](https://docs.min.io/docs/dotnet-client-api-reference)
|
2112
source/developers/go/API.md
Normal file
2112
source/developers/go/API.md
Normal file
File diff suppressed because it is too large
Load Diff
20
source/developers/go/minio-go.rst
Normal file
20
source/developers/go/minio-go.rst
Normal file
@ -0,0 +1,20 @@
|
||||
.. _minio-go-quickstart:
|
||||
|
||||
===================
|
||||
Go Quickstart Guide
|
||||
===================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
.. include:: /developers/go/quickstart.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
/developers/go/API.md
|
246
source/developers/go/quickstart.md
Normal file
246
source/developers/go/quickstart.md
Normal file
@ -0,0 +1,246 @@
|
||||
# MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage [](https://slack.min.io) [](https://sourcegraph.com/github.com/minio/minio-go?badge) [](https://github.com/minio/minio-go/blob/master/LICENSE)
|
||||
|
||||
The MinIO Go Client SDK provides simple APIs to access any Amazon S3 compatible object storage.
|
||||
|
||||
This quickstart guide will show you how to install the MinIO client SDK, connect to MinIO, and provide a walkthrough for a simple file uploader. For a complete list of APIs and examples, please take a look at the [Go Client API Reference](https://docs.min.io/docs/golang-client-api-reference).
|
||||
|
||||
This document assumes that you have a working [Go development environment](https://golang.org/doc/install).
|
||||
|
||||
## Download from Github
|
||||
```sh
|
||||
go get github.com/minio/minio-go/v7
|
||||
```
|
||||
|
||||
## Initialize MinIO Client
|
||||
MinIO client requires the following four parameters specified to connect to an Amazon S3 compatible object storage.
|
||||
|
||||
| Parameter | Description|
|
||||
| :--- | :--- |
|
||||
| endpoint | URL to object storage service. |
|
||||
| _minio.Options_ | All the options such as credentials, custom transport etc. |
|
||||
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
|
||||
func main() {
|
||||
endpoint := "play.min.io"
|
||||
accessKeyID := "Q3AM3UQ867SPQQA43P2F"
|
||||
secretAccessKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
|
||||
useSSL := true
|
||||
|
||||
// Initialize minio client object.
|
||||
minioClient, err := minio.New(endpoint, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
|
||||
Secure: useSSL,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
log.Printf("%#v\n", minioClient) // minioClient is now set up
|
||||
}
|
||||
```
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
This example program connects to an object storage server, creates a bucket and uploads a file to the bucket.
|
||||
|
||||
We will use the MinIO server running at [https://play.min.io](https://play.min.io) in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
|
||||
|
||||
### FileUploader.go
|
||||
```go
|
||||
package main
|
||||
|
||||
import (
|
||||
"context"
|
||||
"log"
|
||||
|
||||
"github.com/minio/minio-go/v7"
|
||||
"github.com/minio/minio-go/v7/pkg/credentials"
|
||||
)
|
||||
|
||||
func main() {
|
||||
ctx := context.Background()
|
||||
endpoint := "play.min.io"
|
||||
accessKeyID := "Q3AM3UQ867SPQQA43P2F"
|
||||
secretAccessKey := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
|
||||
useSSL := true
|
||||
|
||||
// Initialize minio client object.
|
||||
minioClient, err := minio.New(endpoint, &minio.Options{
|
||||
Creds: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
|
||||
Secure: useSSL,
|
||||
})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
// Make a new bucket called mymusic.
|
||||
bucketName := "mymusic"
|
||||
location := "us-east-1"
|
||||
|
||||
err = minioClient.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: location})
|
||||
if err != nil {
|
||||
// Check to see if we already own this bucket (which happens if you run this twice)
|
||||
exists, errBucketExists := minioClient.BucketExists(ctx, bucketName)
|
||||
if errBucketExists == nil && exists {
|
||||
log.Printf("We already own %s\n", bucketName)
|
||||
} else {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
} else {
|
||||
log.Printf("Successfully created %s\n", bucketName)
|
||||
}
|
||||
|
||||
// Upload the zip file
|
||||
objectName := "golden-oldies.zip"
|
||||
filePath := "/tmp/golden-oldies.zip"
|
||||
contentType := "application/zip"
|
||||
|
||||
// Upload the zip file with FPutObject
|
||||
info, err := minioClient.FPutObject(ctx, bucketName, objectName, filePath, minio.PutObjectOptions{ContentType: contentType})
|
||||
if err != nil {
|
||||
log.Fatalln(err)
|
||||
}
|
||||
|
||||
log.Printf("Successfully uploaded %s of size %d\n", objectName, info.Size)
|
||||
}
|
||||
```
|
||||
|
||||
### Run FileUploader
|
||||
```sh
|
||||
go run file-uploader.go
|
||||
2016/08/13 17:03:28 Successfully created mymusic
|
||||
2016/08/13 17:03:40 Successfully uploaded golden-oldies.zip of size 16253413
|
||||
|
||||
mc ls play/mymusic/
|
||||
[2016-05-27 16:02:16 PDT] 17MiB golden-oldies.zip
|
||||
```
|
||||
|
||||
## API Reference
|
||||
The full API Reference is available here.
|
||||
|
||||
* [Complete API Reference](https://docs.min.io/docs/golang-client-api-reference)
|
||||
|
||||
### API Reference : Bucket Operations
|
||||
* [`MakeBucket`](https://docs.min.io/docs/golang-client-api-reference#MakeBucket)
|
||||
* [`ListBuckets`](https://docs.min.io/docs/golang-client-api-reference#ListBuckets)
|
||||
* [`BucketExists`](https://docs.min.io/docs/golang-client-api-reference#BucketExists)
|
||||
* [`RemoveBucket`](https://docs.min.io/docs/golang-client-api-reference#RemoveBucket)
|
||||
* [`ListObjects`](https://docs.min.io/docs/golang-client-api-reference#ListObjects)
|
||||
* [`ListIncompleteUploads`](https://docs.min.io/docs/golang-client-api-reference#ListIncompleteUploads)
|
||||
|
||||
### API Reference : Bucket policy Operations
|
||||
* [`SetBucketPolicy`](https://docs.min.io/docs/golang-client-api-reference#SetBucketPolicy)
|
||||
* [`GetBucketPolicy`](https://docs.min.io/docs/golang-client-api-reference#GetBucketPolicy)
|
||||
|
||||
### API Reference : Bucket notification Operations
|
||||
* [`SetBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#SetBucketNotification)
|
||||
* [`GetBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#GetBucketNotification)
|
||||
* [`RemoveAllBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#RemoveAllBucketNotification)
|
||||
* [`ListenBucketNotification`](https://docs.min.io/docs/golang-client-api-reference#ListenBucketNotification) (MinIO Extension)
|
||||
* [`ListenNotification`](https://docs.min.io/docs/golang-client-api-reference#ListenNotification) (MinIO Extension)
|
||||
|
||||
### API Reference : File Object Operations
|
||||
* [`FPutObject`](https://docs.min.io/docs/golang-client-api-reference#FPutObject)
|
||||
* [`FGetObject`](https://docs.min.io/docs/golang-client-api-reference#FGetObject)
|
||||
|
||||
### API Reference : Object Operations
|
||||
* [`GetObject`](https://docs.min.io/docs/golang-client-api-reference#GetObject)
|
||||
* [`PutObject`](https://docs.min.io/docs/golang-client-api-reference#PutObject)
|
||||
* [`PutObjectStreaming`](https://docs.min.io/docs/golang-client-api-reference#PutObjectStreaming)
|
||||
* [`StatObject`](https://docs.min.io/docs/golang-client-api-reference#StatObject)
|
||||
* [`CopyObject`](https://docs.min.io/docs/golang-client-api-reference#CopyObject)
|
||||
* [`RemoveObject`](https://docs.min.io/docs/golang-client-api-reference#RemoveObject)
|
||||
* [`RemoveObjects`](https://docs.min.io/docs/golang-client-api-reference#RemoveObjects)
|
||||
* [`RemoveIncompleteUpload`](https://docs.min.io/docs/golang-client-api-reference#RemoveIncompleteUpload)
|
||||
* [`SelectObjectContent`](https://docs.min.io/docs/golang-client-api-reference#SelectObjectContent)
|
||||
|
||||
|
||||
### API Reference : Presigned Operations
|
||||
* [`PresignedGetObject`](https://docs.min.io/docs/golang-client-api-reference#PresignedGetObject)
|
||||
* [`PresignedPutObject`](https://docs.min.io/docs/golang-client-api-reference#PresignedPutObject)
|
||||
* [`PresignedHeadObject`](https://docs.min.io/docs/golang-client-api-reference#PresignedHeadObject)
|
||||
* [`PresignedPostPolicy`](https://docs.min.io/docs/golang-client-api-reference#PresignedPostPolicy)
|
||||
|
||||
### API Reference : Client custom settings
|
||||
* [`SetAppInfo`](https://docs.min.io/docs/golang-client-api-reference#SetAppInfo)
|
||||
* [`TraceOn`](https://docs.min.io/docs/golang-client-api-reference#TraceOn)
|
||||
* [`TraceOff`](https://docs.min.io/docs/golang-client-api-reference#TraceOff)
|
||||
|
||||
## Full Examples
|
||||
|
||||
### Full Examples : Bucket Operations
|
||||
* [makebucket.go](https://github.com/minio/minio-go/blob/master/examples/s3/makebucket.go)
|
||||
* [listbuckets.go](https://github.com/minio/minio-go/blob/master/examples/s3/listbuckets.go)
|
||||
* [bucketexists.go](https://github.com/minio/minio-go/blob/master/examples/s3/bucketexists.go)
|
||||
* [removebucket.go](https://github.com/minio/minio-go/blob/master/examples/s3/removebucket.go)
|
||||
* [listobjects.go](https://github.com/minio/minio-go/blob/master/examples/s3/listobjects.go)
|
||||
* [listobjectsV2.go](https://github.com/minio/minio-go/blob/master/examples/s3/listobjectsV2.go)
|
||||
* [listincompleteuploads.go](https://github.com/minio/minio-go/blob/master/examples/s3/listincompleteuploads.go)
|
||||
|
||||
### Full Examples : Bucket policy Operations
|
||||
* [setbucketpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketpolicy.go)
|
||||
* [getbucketpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketpolicy.go)
|
||||
* [listbucketpolicies.go](https://github.com/minio/minio-go/blob/master/examples/s3/listbucketpolicies.go)
|
||||
|
||||
### Full Examples : Bucket lifecycle Operations
|
||||
* [setbucketlifecycle.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketlifecycle.go)
|
||||
* [getbucketlifecycle.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketlifecycle.go)
|
||||
|
||||
### Full Examples : Bucket encryption Operations
|
||||
* [setbucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketencryption.go)
|
||||
* [getbucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketencryption.go)
|
||||
* [deletebucketencryption.go](https://github.com/minio/minio-go/blob/master/examples/s3/deletebucketencryption.go)
|
||||
|
||||
### Full Examples : Bucket replication Operations
|
||||
* [setbucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketreplication.go)
|
||||
* [getbucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketreplication.go)
|
||||
* [removebucketreplication.go](https://github.com/minio/minio-go/blob/master/examples/s3/removebucketreplication.go)
|
||||
|
||||
### Full Examples : Bucket notification Operations
|
||||
* [setbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/setbucketnotification.go)
|
||||
* [getbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/getbucketnotification.go)
|
||||
* [removeallbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeallbucketnotification.go)
|
||||
* [listenbucketnotification.go](https://github.com/minio/minio-go/blob/master/examples/minio/listenbucketnotification.go) (MinIO Extension)
|
||||
* [listennotification.go](https://github.com/minio/minio-go/blob/master/examples/minio/listen-notification.go) (MinIO Extension)
|
||||
|
||||
### Full Examples : File Object Operations
|
||||
* [fputobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/fputobject.go)
|
||||
* [fgetobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/fgetobject.go)
|
||||
|
||||
### Full Examples : Object Operations
|
||||
* [putobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/putobject.go)
|
||||
* [getobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/getobject.go)
|
||||
* [statobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/statobject.go)
|
||||
* [copyobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/copyobject.go)
|
||||
* [removeobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeobject.go)
|
||||
* [removeincompleteupload.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeincompleteupload.go)
|
||||
* [removeobjects.go](https://github.com/minio/minio-go/blob/master/examples/s3/removeobjects.go)
|
||||
|
||||
### Full Examples : Encrypted Object Operations
|
||||
* [put-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/put-encrypted-object.go)
|
||||
* [get-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/get-encrypted-object.go)
|
||||
* [fput-encrypted-object.go](https://github.com/minio/minio-go/blob/master/examples/s3/fputencrypted-object.go)
|
||||
|
||||
### Full Examples : Presigned Operations
|
||||
* [presignedgetobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedgetobject.go)
|
||||
* [presignedputobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedputobject.go)
|
||||
* [presignedheadobject.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedheadobject.go)
|
||||
* [presignedpostpolicy.go](https://github.com/minio/minio-go/blob/master/examples/s3/presignedpostpolicy.go)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [MinIO Go Client SDK API Reference](https://docs.min.io/docs/golang-client-api-reference)
|
||||
|
||||
## Contribute
|
||||
[Contributors Guide](https://github.com/minio/minio-go/blob/master/CONTRIBUTING.md)
|
||||
|
||||
## License
|
||||
This SDK is distributed under the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0), see [LICENSE](https://github.com/minio/minio-go/blob/master/LICENSE) and [NOTICE](https://github.com/minio/minio-go/blob/master/NOTICE) for more information.
|
1919
source/developers/java/API.md
Normal file
1919
source/developers/java/API.md
Normal file
File diff suppressed because it is too large
Load Diff
18
source/developers/java/minio-java.rst
Normal file
18
source/developers/java/minio-java.rst
Normal file
@ -0,0 +1,18 @@
|
||||
.. _minio-java-quickstart:
|
||||
|
||||
=====================
|
||||
Java Quickstart Guide
|
||||
=====================
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
.. include:: /developers/java/quickstart.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
/developers/java/API.md
|
117
source/developers/java/quickstart.md
Normal file
117
source/developers/java/quickstart.md
Normal file
@ -0,0 +1,117 @@
|
||||
# MinIO Java SDK for Amazon S3 Compatible Cloud Storage [](https://slack.min.io)
|
||||
|
||||
MinIO Java SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.
|
||||
|
||||
For a complete list of APIs and examples, please take a look at the [Java Client API Reference](https://docs.min.io/docs/java-client-api-reference) documentation.
|
||||
|
||||
## Minimum Requirements
|
||||
Java 1.8 or above.
|
||||
|
||||
## Maven usage
|
||||
```xml
|
||||
<dependency>
|
||||
<groupId>io.minio</groupId>
|
||||
<artifactId>minio</artifactId>
|
||||
<version>8.4.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
## Gradle usage
|
||||
```
|
||||
dependencies {
|
||||
implementation("io.minio:minio:8.4.0")
|
||||
}
|
||||
```
|
||||
|
||||
## JAR download
|
||||
The latest JAR can be downloaded from [here](https://repo1.maven.org/maven2/io/minio/minio/8.4.0/)
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
This example program connects to an object storage server, makes a bucket on the server and then uploads a file to the bucket.
|
||||
|
||||
You need three items in order to connect to an object storage server.
|
||||
|
||||
| Parameters | Description |
|
||||
|------------|------------------------------------------------------------|
|
||||
| Endpoint | URL to S3 service. |
|
||||
| Access Key | Access key (aka user ID) of an account in the S3 service. |
|
||||
| Secret Key | Secret key (aka password) of an account in the S3 service. |
|
||||
|
||||
This example uses MinIO server playground [https://play.min.io](https://play.min.io). Feel free to use this service for test and development.
|
||||
|
||||
### FileUploader.java
|
||||
```java
|
||||
import io.minio.BucketExistsArgs;
|
||||
import io.minio.MakeBucketArgs;
|
||||
import io.minio.MinioClient;
|
||||
import io.minio.UploadObjectArgs;
|
||||
import io.minio.errors.MinioException;
|
||||
import java.io.IOException;
|
||||
import java.security.InvalidKeyException;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
|
||||
public class FileUploader {
|
||||
public static void main(String[] args)
|
||||
throws IOException, NoSuchAlgorithmException, InvalidKeyException {
|
||||
try {
|
||||
// Create a minioClient with the MinIO server playground, its access key and secret key.
|
||||
MinioClient minioClient =
|
||||
MinioClient.builder()
|
||||
.endpoint("https://play.min.io")
|
||||
.credentials("Q3AM3UQ867SPQQA43P2F", "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG")
|
||||
.build();
|
||||
|
||||
// Make 'asiatrip' bucket if not exist.
|
||||
boolean found =
|
||||
minioClient.bucketExists(BucketExistsArgs.builder().bucket("asiatrip").build());
|
||||
if (!found) {
|
||||
// Make a new bucket called 'asiatrip'.
|
||||
minioClient.makeBucket(MakeBucketArgs.builder().bucket("asiatrip").build());
|
||||
} else {
|
||||
System.out.println("Bucket 'asiatrip' already exists.");
|
||||
}
|
||||
|
||||
// Upload '/home/user/Photos/asiaphotos.zip' as object name 'asiaphotos-2015.zip' to bucket
|
||||
// 'asiatrip'.
|
||||
minioClient.uploadObject(
|
||||
UploadObjectArgs.builder()
|
||||
.bucket("asiatrip")
|
||||
.object("asiaphotos-2015.zip")
|
||||
.filename("/home/user/Photos/asiaphotos.zip")
|
||||
.build());
|
||||
System.out.println(
|
||||
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
|
||||
+ "object 'asiaphotos-2015.zip' to bucket 'asiatrip'.");
|
||||
} catch (MinioException e) {
|
||||
System.out.println("Error occurred: " + e);
|
||||
System.out.println("HTTP trace: " + e.httpTrace());
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Compile FileUploader
|
||||
```sh
|
||||
$ javac -cp minio-8.4.0-all.jar FileUploader.java
|
||||
```
|
||||
|
||||
#### Run FileUploader
|
||||
```sh
|
||||
$ java -cp minio-8.4.0-all.jar:. FileUploader
|
||||
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
|
||||
|
||||
$ mc ls play/asiatrip/
|
||||
[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip
|
||||
```
|
||||
|
||||
## More References
|
||||
* [Java Client API Reference](https://docs.min.io/docs/java-client-api-reference)
|
||||
* [Javadoc](https://minio-java.min.io/)
|
||||
* [Examples](https://github.com/minio/minio-java/tree/release/examples)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
* [Build your own Photo API Service - Full Application Example ](https://github.com/minio/minio-java-rest-example)
|
||||
|
||||
## Contribute
|
||||
Please refer [Contributors Guide](https://github.com/minio/minio-java/blob/release/CONTRIBUTING.md)
|
44
source/developers/minio-drivers.rst
Normal file
44
source/developers/minio-drivers.rst
Normal file
@ -0,0 +1,44 @@
|
||||
.. _minio-drivers:
|
||||
|
||||
===============================
|
||||
Software Development Kits (SDK)
|
||||
===============================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
MinIO publishes the following Software Development Kits (SDK):
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 30 30 40
|
||||
:width: 100%
|
||||
|
||||
* - Language
|
||||
- Reference
|
||||
- Download
|
||||
|
||||
* - Java (``minio-java``)
|
||||
- :ref:`MinIO Java SDK Reference <minio-java-quickstart>`
|
||||
- ToDo
|
||||
|
||||
* - Python (``minio-py``)
|
||||
- :doc:`MinIO Python SDK Reference </developers/python/minio-py>`
|
||||
- ToDo
|
||||
|
||||
* - Go (``minio-go``)
|
||||
- :doc:`MinIO Go SDK Reference </developers/go/minio-go>`
|
||||
- ToDo
|
||||
|
||||
* - .NET (``minio-dotnet``)
|
||||
- :doc:`MinIO .NET SDK Reference </developers/dotnet/minio-dotnet>`
|
||||
- ToDo
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
:maxdepth: 1
|
||||
|
||||
/developers/java/minio-java
|
||||
/developers/python/minio-py
|
||||
/developers/go/minio-go
|
||||
/developers/dotnet/minio-dotnet
|
1853
source/developers/python/API.md
Normal file
1853
source/developers/python/API.md
Normal file
File diff suppressed because it is too large
Load Diff
20
source/developers/python/minio-py.rst
Normal file
20
source/developers/python/minio-py.rst
Normal file
@ -0,0 +1,20 @@
|
||||
.. _minio-python-quickstart:
|
||||
|
||||
=======================
|
||||
Python Quickstart Guide
|
||||
=======================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
.. include:: /developers/python/quickstart.md
|
||||
:parser: myst_parser.sphinx_
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
|
||||
/developers/python/API.md
|
96
source/developers/python/quickstart.md
Normal file
96
source/developers/python/quickstart.md
Normal file
@ -0,0 +1,96 @@
|
||||
# MinIO Python SDK for Amazon S3 Compatible Cloud Storage [](https://slack.min.io)
|
||||
|
||||
MinIO Python SDK is Simple Storage Service (aka S3) client to perform bucket and object operations to any Amazon S3 compatible object storage service.
|
||||
|
||||
For a complete list of APIs and examples, please take a look at the [Python Client API Reference](https://docs.min.io/docs/python-client-api-reference)
|
||||
|
||||
## Minimum Requirements
|
||||
Python 3.6 or higher.
|
||||
|
||||
## Download using pip
|
||||
|
||||
```sh
|
||||
pip3 install minio
|
||||
```
|
||||
|
||||
## Download source
|
||||
|
||||
```sh
|
||||
git clone https://github.com/minio/minio-py
|
||||
cd minio-py
|
||||
python setup.py install
|
||||
```
|
||||
|
||||
## Quick Start Example - File Uploader
|
||||
This example program connects to an S3-compatible object storage server, make a bucket on that server, and upload a file to the bucket.
|
||||
|
||||
You need the following items to connect to an S3-compatible object storage server:
|
||||
|
||||
| Parameters | Description |
|
||||
|------------|------------------------------------------------------------|
|
||||
| Endpoint | URL to S3 service. |
|
||||
| Access Key | Access key (aka user ID) of an account in the S3 service. |
|
||||
| Secret Key | Secret key (aka password) of an account in the S3 service. |
|
||||
|
||||
This example uses MinIO server playground [https://play.min.io](https://play.min.io). Feel free to use this service for test and development.
|
||||
|
||||
### file_uploader.py
|
||||
```py
|
||||
from minio import Minio
|
||||
from minio.error import S3Error
|
||||
|
||||
|
||||
def main():
|
||||
# Create a client with the MinIO server playground, its access key
|
||||
# and secret key.
|
||||
client = Minio(
|
||||
"play.min.io",
|
||||
access_key="Q3AM3UQ867SPQQA43P2F",
|
||||
secret_key="zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG",
|
||||
)
|
||||
|
||||
# Make 'asiatrip' bucket if not exist.
|
||||
found = client.bucket_exists("asiatrip")
|
||||
if not found:
|
||||
client.make_bucket("asiatrip")
|
||||
else:
|
||||
print("Bucket 'asiatrip' already exists")
|
||||
|
||||
# Upload '/home/user/Photos/asiaphotos.zip' as object name
|
||||
# 'asiaphotos-2015.zip' to bucket 'asiatrip'.
|
||||
client.fput_object(
|
||||
"asiatrip", "asiaphotos-2015.zip", "/home/user/Photos/asiaphotos.zip",
|
||||
)
|
||||
print(
|
||||
"'/home/user/Photos/asiaphotos.zip' is successfully uploaded as "
|
||||
"object 'asiaphotos-2015.zip' to bucket 'asiatrip'."
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
try:
|
||||
main()
|
||||
except S3Error as exc:
|
||||
print("error occurred.", exc)
|
||||
```
|
||||
|
||||
#### Run File Uploader
|
||||
```sh
|
||||
$ python file_uploader.py
|
||||
'/home/user/Photos/asiaphotos.zip' is successfully uploaded as object 'asiaphotos-2015.zip' to bucket 'asiatrip'.
|
||||
|
||||
$ mc ls play/asiatrip/
|
||||
[2016-06-02 18:10:29 PDT] 82KiB asiaphotos-2015.zip
|
||||
```
|
||||
|
||||
## More References
|
||||
* [Python Client API Reference](https://docs.min.io/docs/python-client-api-reference)
|
||||
* [Examples](https://github.com/minio/minio-py/tree/release/examples)
|
||||
|
||||
## Explore Further
|
||||
* [Complete Documentation](https://docs.min.io)
|
||||
|
||||
## Contribute
|
||||
Please refer [Contributors Guide](https://github.com/minio/minio-py/blob/release/CONTRIBUTING.md)
|
||||
|
||||
[](https://pypi.python.org/pypi/minio)
|
40
source/developers/security-token-service.rst
Normal file
40
source/developers/security-token-service.rst
Normal file
@ -0,0 +1,40 @@
|
||||
.. _minio-security-token-service:
|
||||
|
||||
============================
|
||||
Security Token Service (STS)
|
||||
============================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
The MinIO Security Token Service (STS) APIs allow applications to generate temporary credentials for accessing the MinIO deployment.
|
||||
|
||||
The STS API is *required* for MinIO deployments configured to use external identity managers, as the API allows conversion of the external IDP credentials into AWS Signature v4-compatible credentials.
|
||||
|
||||
MinIO supports the following STS API endpoints:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 30 30 40
|
||||
|
||||
* - Endpoint
|
||||
- Supported IDP
|
||||
- Description
|
||||
|
||||
* - AssumeRoleWithWebIdentity
|
||||
- OpenID Connect
|
||||
- Generates an access key and secret key using the JWT token returned by the OIDC provider
|
||||
|
||||
* - AssumeRoleWithLDAPIdentity
|
||||
- Active Directory / LDAP
|
||||
- Generates an access key and secret key using the AD/LDAP credentials specified to the API endpoint.
|
||||
|
||||
.. toctree::
|
||||
:titlesonly:
|
||||
:hidden:
|
||||
:glob:
|
||||
|
||||
/developers/security-token-service/*
|
@ -0,0 +1,154 @@
|
||||
.. _minio-sts-assumerolewithldapidentity:
|
||||
|
||||
==============================
|
||||
``AssumeRoleWithLDAPIdentity``
|
||||
==============================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
The MinIO Security Token Service (STS) ``AssumeRoleWithLDAPIdentity`` API
|
||||
endpoint generates temporary access credentials using Active Directory
|
||||
or LDAP user credentials. This page documents the MinIO
|
||||
server ``AssumeRoleWithLDAPIdentity`` endpoint. For instructions on
|
||||
implementing STS using an S3-compatible SDK, defer to the documentation
|
||||
for that SDK.
|
||||
|
||||
The MinIO STS ``AssumeRoleWithLDAPIdentity`` API endpoint is modeled
|
||||
after the
|
||||
AWS :aws-docs:`AssumeRoleWithWebIdentity
|
||||
<STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html>`
|
||||
endpoint and shares certain request/response elements. This page
|
||||
documents the MinIO-specific syntax and links out to the AWS reference for
|
||||
all shared elements.
|
||||
|
||||
Request Endpoint
|
||||
----------------
|
||||
|
||||
The ``AssumeRoleWithLDAPIdentity`` endpoint has the following form:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
POST https://minio.example.net?Action=AssumeRoleWithLDAPIdentity[&ARGS]
|
||||
|
||||
The following example uses all supported arguments. Replace the
|
||||
``minio.example.net`` hostname with the appropriate URL for your MinIO
|
||||
cluster:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
POST https://minio.example.net?Action=AssumeRoleWithLDAPIdentity
|
||||
&LDAPUsername=USERNAME
|
||||
&LDAPPassword=PASSWORD
|
||||
&Version=2011-06-15
|
||||
&Policy={}
|
||||
|
||||
Request Query Parameters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This endpoint supports the following query parameters:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 20 20 60
|
||||
:width: 100%
|
||||
|
||||
* - Parameter
|
||||
- Type
|
||||
- Description
|
||||
|
||||
* - ``LDAPUsername``
|
||||
- string
|
||||
- *Required*
|
||||
|
||||
Specify the username of the AD/LDAP user as whom you want to
|
||||
authenticate.
|
||||
|
||||
* - ``LDAPPassword``
|
||||
- string
|
||||
- *Required*
|
||||
|
||||
Specify the password for the ``LDAPUsername``.
|
||||
|
||||
* - ``Version``
|
||||
- string
|
||||
- *Required*
|
||||
|
||||
Specify ``2011-06-15``.
|
||||
|
||||
|
||||
* - ``Policy``
|
||||
- string
|
||||
- *Optional*
|
||||
|
||||
Specify the URL-encoded JSON-formatted :ref:`policy <minio-policy>` to
|
||||
use as an inline session policy.
|
||||
|
||||
- The minimum string length is ``1``.
|
||||
- The maximum string length is ``2048``.
|
||||
|
||||
The resulting permissions for the temporary credentials are the
|
||||
intersection between the :ref:`policy
|
||||
<minio-external-identity-management-ad-ldap-access-control>` matching the Distinguished
|
||||
Name (DN) of the ``LDAPUsername`` and the specified inline policy.
|
||||
Applications can only perform those operations for which they are
|
||||
explicitly authorized.
|
||||
|
||||
The inline policy can specify a subset of permissions allowed by the
|
||||
policy specified in the DN policy. Applications can never assume
|
||||
more privileges than those specified in the DN policy.
|
||||
|
||||
Omit to use only the DN policy.
|
||||
|
||||
See :ref:`minio-access-management` for more information on MinIO
|
||||
authentication and authorization.
|
||||
|
||||
Response Elements
|
||||
-----------------
|
||||
|
||||
The XML response for this API endpoint is similar to the AWS
|
||||
:aws-docs:`AssumeRoleWithLDAPIdentity response
|
||||
<STS/latest/APIReference/API_AssumeRoleWithLDAPIdentity.html#API_AssumeRoleWithLDAPIdentity_ResponseElements>`.
|
||||
Specifically, MinIO returns an ``AssumeRoleWithLDAPIdentityResult`` object,
|
||||
where the ``AssumedRoleUser.Credentials`` object contains the temporary
|
||||
credentials generated by MinIO:
|
||||
|
||||
- ``AccessKeyId`` - The access key applications use for authentication.
|
||||
- ``SecretKeyId`` - The secret key applications use for authentication.
|
||||
- ``Expiration`` - The ISO-8601 date-time after which the credentials expire.
|
||||
- ``SessionToken`` - The session token applications use for authentication. Some
|
||||
SDKs may require this field when using temporary credentials.
|
||||
|
||||
The following example is similar to the response returned by the MinIO STS
|
||||
``AssumeRoleWithLDAPIdentity`` endpoint:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AssumeRoleWithLDAPIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
|
||||
<AssumeRoleWithLDAPIdentityResult>
|
||||
<AssumedRoleUser>
|
||||
<Arn/>
|
||||
<AssumeRoleId/>
|
||||
</AssumedRoleUser>
|
||||
<Credentials>
|
||||
<AccessKeyId>Y4RJU1RNFGK48LGO9I2S</AccessKeyId>
|
||||
<SecretAccessKey>sYLRKS1Z7hSjluf6gEbb9066hnx315wHTiACPAjg</SecretAccessKey>
|
||||
<Expiration>2019-08-08T20:26:12Z</Expiration>
|
||||
<SessionToken>eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJZNFJKVTFSTkZHSzQ4TEdPOUkyUyIsImF1ZCI6IlBvRWdYUDZ1Vk80NUlzRU5SbmdEWGo1QXU1WWEiLCJhenAiOiJQb0VnWFA2dVZPNDVJc0VOUm5nRFhqNUF1NVlhIiwiZXhwIjoxNTQxODExMDcxLCJpYXQiOjE1NDE4MDc0NzEsImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0Ojk0NDMvb2F1dGgyL3Rva2VuIiwianRpIjoiYTBiMjc2MjktZWUxYS00M2JmLTg3MzktZjMzNzRhNGNkYmMwIn0.ewHqKVFTaP-j_kgZrcOEKroNUjk10GEp8bqQjxBbYVovV0nHO985VnRESFbcT6XMDDKHZiWqN2vi_ETX_u3Q-w</SessionToken>
|
||||
</Credentials>
|
||||
</AssumeRoleWithLDAPIdentityResult>
|
||||
<ResponseMetadata/>
|
||||
</AssumeRoleWithLDAPIdentityResponse>
|
||||
|
||||
Error Elements
|
||||
--------------
|
||||
|
||||
The XML error response for this API endpoint is similar to the AWS
|
||||
:aws-docs:`AssumeRoleWithLDAPIdentity response
|
||||
<STS/latest/APIReference/API_AssumeRoleWithLDAPIdentity.html#API_AssumeRoleWithLDAPIdentity_Errors>`.
|
||||
|
||||
|
@ -0,0 +1,165 @@
|
||||
.. _minio-sts-assumerolewithwebidentity:
|
||||
|
||||
=============================
|
||||
``AssumeRoleWithWebIdentity``
|
||||
=============================
|
||||
|
||||
.. default-domain:: minio
|
||||
|
||||
.. contents:: Table of Contents
|
||||
:local:
|
||||
:depth: 2
|
||||
|
||||
The MinIO Security Token Service (STS) ``AssumeRoleWithWebIdentity`` API
|
||||
endpoint generates temporary access credentials using a
|
||||
JSON Web Token (JWT) returned from a
|
||||
:ref:`configured OpenID IDentity Provider (IDP)
|
||||
<minio-external-identity-management-openid-configure>`. This page documents the MinIO
|
||||
server ``AssumeRoleWithWebIdentity`` endpoint. For instructions on
|
||||
implementing STS using an S3-compatible SDK, defer to the documentation
|
||||
for that SDK.
|
||||
|
||||
The MinIO STS ``AssumeRoleWithWebIdentity`` API endpoint is modeled
|
||||
after the
|
||||
AWS :aws-docs:`AssumeRoleWithWebIdentity
|
||||
<STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html>`
|
||||
endpoint and shares certain request/response elements. This page
|
||||
documents the MinIO-specific syntax and links out to the AWS reference for
|
||||
all shared elements.
|
||||
|
||||
Request Endpoint
|
||||
----------------
|
||||
|
||||
The ``AssumeRoleWithWebIdentity`` endpoint has the following form:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
POST https://minio.example.net?Action=AssumeRoleWithWebIdentity[&ARGS]
|
||||
|
||||
The following example uses all supported arguments. Replace the
|
||||
``minio.example.net`` hostname with the appropriate URL for your MinIO
|
||||
cluster:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
POST https://minio.example.net?Action=AssumeRoleWithWebIdentity
|
||||
&WebIdentityToken=TOKEN
|
||||
&Version=2011-06-15
|
||||
&DurationSeconds=86000
|
||||
&Policy={}
|
||||
|
||||
Request Query Parameters
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
This endpoint supports the following query parameters:
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
:widths: 20 20 60
|
||||
:width: 100%
|
||||
|
||||
* - Parameter
|
||||
- Type
|
||||
- Description
|
||||
|
||||
* - ``WebIdentityToken``
|
||||
- string
|
||||
- *Required*
|
||||
|
||||
Specify the JSON Web Token (JWT) returned by the
|
||||
:ref:`configured OpenID IDentity Provider
|
||||
<minio-external-identity-management-openid-configure>`.
|
||||
|
||||
* - ``Version``
|
||||
- string
|
||||
- *Required*
|
||||
|
||||
Specify ``2011-06-15``.
|
||||
|
||||
* - ``DurationSeconds``
|
||||
- integer
|
||||
- *Optional*
|
||||
|
||||
Specify the number of seconds after which the temporary credentials
|
||||
expire. Defaults to ``3600``.
|
||||
|
||||
- The minimum value is ``900`` or 15 minutes.
|
||||
- The maximum value is ``604800`` or 7 days.
|
||||
|
||||
If ``DurationSeconds`` is omitted, MinIO checks the JWT token for an
|
||||
``exp`` claim before using the default duration. See
|
||||
`RFC 7519 4.1.4: Expiration Time Claim
|
||||
<https://datatracker.ietf.org/doc/html/rfc7519#section-4.1.4>`__
|
||||
for more information on JSON web token expiration.
|
||||
|
||||
* - ``Policy``
|
||||
- string
|
||||
- *Optional*
|
||||
|
||||
Specify the URL-encoded JSON-formatted :ref:`policy <minio-policy>` to
|
||||
use as an inline session policy.
|
||||
|
||||
- The minimum string length is ``1``.
|
||||
- The maximum string length is ``2048``.
|
||||
|
||||
The resulting permissions for the temporary credentials are the
|
||||
intersection between the policy specified as part of the :ref:`JWT claim
|
||||
<minio-external-identity-management-openid-access-control>` and the specified inline
|
||||
policy. Applications can only perform those operations for which they
|
||||
are explicitly authorized.
|
||||
|
||||
The inline policy can specify a subset of permissions allowed by the
|
||||
policy specified in the JWT claim. Applications can never assume
|
||||
more privileges than those specified in the JWT claim policy.
|
||||
|
||||
Omit to use only the JWT claim policy.
|
||||
|
||||
See :ref:`minio-access-management` for more information on MinIO
|
||||
authentication and authorization.
|
||||
|
||||
Response Elements
|
||||
-----------------
|
||||
|
||||
The XML response for this API endpoint is similar to the AWS
|
||||
:aws-docs:`AssumeRoleWithWebIdentity response
|
||||
<STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html#API_AssumeRoleWithWebIdentity_ResponseElements>`.
|
||||
Specifically, MinIO returns an ``AssumeRoleWithWebIdentityResult`` object,
|
||||
where the ``AssumedRoleUser.Credentials`` object contains the temporary
|
||||
credentials generated by MinIO:
|
||||
|
||||
- ``AccessKeyId`` - The access key applications use for authentication.
|
||||
- ``SecretKeyId`` - The secret key applications use for authentication.
|
||||
- ``Expiration`` - The ISO-8601 date-time after which the credentials expire.
|
||||
- ``SessionToken`` - The session token applications use for authentication. Some
|
||||
SDKs may require this field when using temporary credentials.
|
||||
|
||||
The following example is similar to the response returned by the MinIO STS
|
||||
``AssumeRoleWithWebIdentity`` endpoint:
|
||||
|
||||
.. code-block:: xml
|
||||
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<AssumeRoleWithWebIdentityResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
|
||||
<AssumeRoleWithWebIdentityResult>
|
||||
<AssumedRoleUser>
|
||||
<Arn/>
|
||||
<AssumeRoleId/>
|
||||
</AssumedRoleUser>
|
||||
<Credentials>
|
||||
<AccessKeyId>Y4RJU1RNFGK48LGO9I2S</AccessKeyId>
|
||||
<SecretAccessKey>sYLRKS1Z7hSjluf6gEbb9066hnx315wHTiACPAjg</SecretAccessKey>
|
||||
<Expiration>2019-08-08T20:26:12Z</Expiration>
|
||||
<SessionToken>eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhY2Nlc3NLZXkiOiJZNFJKVTFSTkZHSzQ4TEdPOUkyUyIsImF1ZCI6IlBvRWdYUDZ1Vk80NUlzRU5SbmdEWGo1QXU1WWEiLCJhenAiOiJQb0VnWFA2dVZPNDVJc0VOUm5nRFhqNUF1NVlhIiwiZXhwIjoxNTQxODExMDcxLCJpYXQiOjE1NDE4MDc0NzEsImlzcyI6Imh0dHBzOi8vbG9jYWxob3N0Ojk0NDMvb2F1dGgyL3Rva2VuIiwianRpIjoiYTBiMjc2MjktZWUxYS00M2JmLTg3MzktZjMzNzRhNGNkYmMwIn0.ewHqKVFTaP-j_kgZrcOEKroNUjk10GEp8bqQjxBbYVovV0nHO985VnRESFbcT6XMDDKHZiWqN2vi_ETX_u3Q-w</SessionToken>
|
||||
</Credentials>
|
||||
</AssumeRoleWithWebIdentityResult>
|
||||
<ResponseMetadata/>
|
||||
</AssumeRoleWithWebIdentityResponse>
|
||||
|
||||
Error Elements
|
||||
--------------
|
||||
|
||||
The XML error response for this API endpoint is similar to the AWS
|
||||
:aws-docs:`AssumeRoleWithWebIdentity response
|
||||
<STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html#API_AssumeRoleWithWebIdentity_Errors>`.
|
||||
|
||||
|
Reference in New Issue
Block a user