Browse Source
Fix jwt error in admin UI (#8140)
Fix jwt error in admin UI (#8140)
* add jwt token in weed admin headers requests * add jwt token to header for download * :s/upload/download * filer_signing.read despite of filer_signing key * finalize filer_browser_handlers.go * admin: add JWT authorization to file browser handlers * security: fix typos in JWT read validation descriptions * Move security.toml to example and secure keys * security: address PR feedback on JWT enforcement and example keys * security: refactor JWT logic and improve example keys readability * Update docker/Dockerfile.local Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Chris Lu <chris.lu@gmail.com> Co-authored-by: Chris Lu <chrislusf@users.noreply.github.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>pull/8144/head
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 92 additions and 9 deletions
-
1.gitignore
-
1docker/Dockerfile.local
-
34docker/security.toml.example
-
2k8s/charts/seaweedfs/templates/shared/security-configmap.yaml
-
61weed/admin/handlers/file_browser_handlers.go
-
2weed/command/scaffold/security.toml
@ -0,0 +1,34 @@ |
|||||
|
# Put this file to one of the location, with descending priority |
||||
|
# ./security.toml |
||||
|
# $HOME/.seaweedfs/security.toml |
||||
|
# /etc/seaweedfs/security.toml |
||||
|
# this file is read by master, volume server, filer, and worker |
||||
|
|
||||
|
# comma separated origins allowed to make requests to the filer and s3 gateway. |
||||
|
# enter in this format: https://domain.com, or http://localhost:port |
||||
|
[cors.allowed_origins] |
||||
|
values = "*" |
||||
|
|
||||
|
# this jwt signing key is read by master and volume server, and it is used for write operations: |
||||
|
# - the Master server generates the JWT, which can be used to write a certain file on a volume server |
||||
|
# - the Volume server validates the JWT on writing |
||||
|
# the jwt defaults to expire after 10 seconds. |
||||
|
[jwt.signing] |
||||
|
key = "V1JJVEVTRUNSRVRFWEFNUExFMTIzNDU2Nzg5MDEy" # Example: WRITESECRETEXAMPLE123456789012 |
||||
|
# this jwt signing key is read by master and volume server, and it is used for read operations: |
||||
|
# - the Master server generates the JWT, which can be used to read a certain file on a volume server |
||||
|
# - the Volume server validates the JWT on reading |
||||
|
[jwt.signing.read] |
||||
|
key = "UkVBRFNFQ1JFVUVYQU1QTEUxMjM0NTY3ODkwMTI=" # Example: READSECRETEXAMPLE123456789012 |
||||
|
# If this JWT key is configured, Filer only accepts writes over HTTP if they are signed with this JWT: |
||||
|
# - f.e. the S3 API Shim generates the JWT |
||||
|
# - the Filer server validates the JWT on writing |
||||
|
# the jwt defaults to expire after 10 seconds. |
||||
|
[jwt.filer_signing] |
||||
|
key = "RklMRVJXUklURVNFQ1JFVEVYQU1QTEUxMjM0NTY3OA==" # Example: FILERWRITESECRETEXAMPLE12345678 |
||||
|
# If this JWT key is configured, Filer only accepts reads over HTTP if they are signed with this JWT: |
||||
|
# - f.e. the S3 API Shim generates the JWT |
||||
|
# - the Filer server validates the JWT on reading |
||||
|
# the jwt defaults to expire after 10 seconds. |
||||
|
[jwt.filer_signing.read] |
||||
|
key = "RklMRVJSRUFEU0VDUkVURVhBTVBMRTEyMzQ1Njc4OQ==" # Example: FILERREADSECRETEXAMPLE123456789 |
||||
Write
Preview
Loading…
Cancel
Save
Reference in new issue