Change default login message and update config example
Consider "ethereum" auth flow deprecated.
This commit is contained in:
parent
a39b229325
commit
a1af46f566
4 changed files with 12 additions and 10 deletions
|
@ -4,19 +4,22 @@ storage_dir: files
|
||||||
http_host: '127.0.0.1'
|
http_host: '127.0.0.1'
|
||||||
http_port: 8380
|
http_port: 8380
|
||||||
|
|
||||||
# domain name
|
# Domain name
|
||||||
instance_uri: myserver.net
|
instance_uri: myserver.net
|
||||||
instance_title: myserver
|
instance_title: myserver
|
||||||
instance_short_description: my fedi instance
|
instance_short_description: my fedi instance
|
||||||
# Long description can contain markdown syntax
|
# Long description can contain markdown syntax
|
||||||
instance_description: my fedi instance
|
instance_description: my fedi instance
|
||||||
|
|
||||||
# RSA private key can be generated with `mitractl generate-rsa-key`
|
# RSA private key can be generated with `mitractl generate-rsa-key`
|
||||||
instance_rsa_key: null
|
instance_rsa_key: null
|
||||||
registrations_open: false
|
registrations_open: false
|
||||||
# Login message must contain instance URL
|
# EIP-4361 login message
|
||||||
login_message: 'Sign this message to log in to https://myserver.net. Do not sign this message on other sites!'
|
login_message: 'Do not sign this message on other sites!'
|
||||||
|
post_character_limit: 2000
|
||||||
|
|
||||||
# To disable blockchain integration, set `blockchain` to `null`
|
# Blockchain settings
|
||||||
|
# Set `blockchain` key to `null` to disable blockchain integration
|
||||||
blockchain:
|
blockchain:
|
||||||
# CAIP-2 chain ID (https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md)
|
# CAIP-2 chain ID (https://github.com/ChainAgnostic/CAIPs/blob/master/CAIPs/caip-2.md)
|
||||||
chain_id: eip155:31337
|
chain_id: eip155:31337
|
||||||
|
@ -28,6 +31,8 @@ blockchain:
|
||||||
# Instance private key
|
# Instance private key
|
||||||
signing_key: null
|
signing_key: null
|
||||||
|
|
||||||
|
# IPFS settings
|
||||||
|
# Set `ipfs_api_url` key to `null` to disable IPFS integration
|
||||||
ipfs_api_url: 'http://127.0.0.1:5001'
|
ipfs_api_url: 'http://127.0.0.1:5001'
|
||||||
# IPFS gateway for clients
|
# IPFS gateway for clients
|
||||||
ipfs_gateway_url: 'https://ipfs.io'
|
ipfs_gateway_url: 'https://ipfs.io'
|
||||||
|
|
|
@ -19,7 +19,6 @@ paths:
|
||||||
type: string
|
type: string
|
||||||
enum:
|
enum:
|
||||||
- password
|
- password
|
||||||
- ethereum
|
|
||||||
- eip4361
|
- eip4361
|
||||||
example: eip4361
|
example: eip4361
|
||||||
username:
|
username:
|
||||||
|
@ -33,12 +32,8 @@ paths:
|
||||||
description: EIP-4361 signature (required if grant type is "eip4361").
|
description: EIP-4361 signature (required if grant type is "eip4361").
|
||||||
type: string
|
type: string
|
||||||
example: 0x905...
|
example: 0x905...
|
||||||
wallet_address:
|
|
||||||
description: Ethereum wallet address (required if grant type is "ethereum").
|
|
||||||
type: string
|
|
||||||
example: null
|
|
||||||
password:
|
password:
|
||||||
description: Password (required if grant type is "password" or "ethereum").
|
description: Password (required if grant type is "password").
|
||||||
type: string
|
type: string
|
||||||
example: null
|
example: null
|
||||||
required:
|
required:
|
||||||
|
|
|
@ -120,6 +120,7 @@ pub struct Config {
|
||||||
#[serde(default)]
|
#[serde(default)]
|
||||||
pub registrations_open: bool, // default is false
|
pub registrations_open: bool, // default is false
|
||||||
|
|
||||||
|
// EIP-4361 login message
|
||||||
pub login_message: String,
|
pub login_message: String,
|
||||||
|
|
||||||
#[serde(default = "default_post_character_limit")]
|
#[serde(default = "default_post_character_limit")]
|
||||||
|
|
|
@ -33,6 +33,7 @@ async fn token_view(
|
||||||
get_user_by_name(db_client, username).await?
|
get_user_by_name(db_client, username).await?
|
||||||
},
|
},
|
||||||
"ethereum" => {
|
"ethereum" => {
|
||||||
|
// DEPRECATED
|
||||||
let wallet_address = request_data.wallet_address.as_ref()
|
let wallet_address = request_data.wallet_address.as_ref()
|
||||||
.ok_or(ValidationError("wallet address is required"))?;
|
.ok_or(ValidationError("wallet address is required"))?;
|
||||||
validate_wallet_address(wallet_address)?;
|
validate_wallet_address(wallet_address)?;
|
||||||
|
|
Loading…
Reference in a new issue