Skip to main content

eggfetch_core/
auth.rs

1//! Authentication subsystem for eggfetch.
2//!
3//! Provides Basic and Bearer authentication with redacted debug output,
4//! CR/LF injection prevention, and a central apply pipeline.
5//!
6//! Authentication is applied centrally in the client pipeline. Secrets
7//! are never exposed in `Debug`, `Display`, logs, or error messages.
8
9use crate::error::{Error, Result};
10
11/// An authentication scheme applied to outgoing requests.
12///
13/// Authentication is configured at the client level and can be overridden
14/// or disabled per-request. The client applies auth centrally before
15/// sending, after default headers but before the hyper request is built.
16///
17/// # Precedence
18///
19/// 1. Request-level explicit auth (via [`RequestBuilder::auth`])
20/// 2. Request-level auth disabled (via [`RequestBuilder::without_auth`])
21/// 3. Client-level auth (via [`ClientBuilder::auth`])
22/// 4. No auth
23///
24/// [`RequestBuilder::auth`]: crate::request::RequestBuilder::auth
25/// [`RequestBuilder::without_auth`]: crate::request::RequestBuilder::without_auth
26/// [`ClientBuilder::auth`]: crate::client::ClientBuilder::auth
27#[derive(Clone)]
28pub enum AuthScheme {
29    /// HTTP Basic Authentication (`Authorization: Basic <credentials>`).
30    ///
31    /// Only available with the `basic-auth` feature (enabled by the `http1`/`http2`
32    /// compatibility aliases). The lean Bearer-only profile omits this variant
33    /// and its `base64` dependency.
34    #[cfg(feature = "basic-auth")]
35    Basic(BasicAuth),
36    /// HTTP Bearer Token Authentication (`Authorization: Bearer <token>`).
37    Bearer(BearerAuth),
38}
39
40impl AuthScheme {
41    /// Create a Basic auth scheme from username and password.
42    ///
43    /// Only available with the `basic-auth` feature.
44    ///
45    /// # Errors
46    ///
47    /// Returns [`Error::InvalidAuthHeader`] if the username contains `:`
48    /// or if credentials contain invalid header-value bytes.
49    #[cfg(feature = "basic-auth")]
50    pub fn basic(username: impl Into<String>, password: impl Into<String>) -> Result<Self> {
51        Ok(Self::Basic(BasicAuth::new(username, password)?))
52    }
53
54    /// Create a Bearer auth scheme from a token.
55    ///
56    /// # Errors
57    ///
58    /// Returns [`Error::InvalidAuthHeader`] if the token contains CR/LF
59    /// or invalid header-value bytes.
60    pub fn bearer(token: impl Into<String>) -> Result<Self> {
61        Ok(Self::Bearer(BearerAuth::new(token)?))
62    }
63
64    /// Apply this auth scheme to the request headers.
65    ///
66    /// Sets the `Authorization` header to the appropriate value.
67    /// Returns an error if the header value is invalid.
68    pub(crate) fn apply(&self, headers: &mut crate::headers::Headers) -> Result<()> {
69        match self {
70            #[cfg(feature = "basic-auth")]
71            Self::Basic(b) => {
72                let value = b.header_value();
73                headers.insert("authorization", &value)?;
74            }
75            Self::Bearer(b) => {
76                let value = b.header_value();
77                headers.insert("authorization", &value)?;
78            }
79        }
80        Ok(())
81    }
82}
83
84impl std::fmt::Debug for AuthScheme {
85    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
86        match self {
87            #[cfg(feature = "basic-auth")]
88            Self::Basic(b) => f.debug_tuple("Basic").field(b).finish(),
89            Self::Bearer(b) => f.debug_tuple("Bearer").field(b).finish(),
90        }
91    }
92}
93
94/// HTTP Basic Authentication credentials.
95///
96/// Generates `Authorization: Basic base64(username:password)` headers.
97///
98/// Only available with the `basic-auth` feature (enabled by the `http1`/`http2`
99/// compatibility aliases). Bearer-only lean profiles omit this type and the
100/// core `base64` dependency.
101///
102/// # Security
103///
104/// The `Debug` and `Display` implementations redact both username and
105/// password. Credentials are never exposed in error messages or logs.
106///
107/// # Policy
108///
109/// - Usernames containing `:` are rejected (RFC 7617 ambiguity).
110/// - Passwords may be empty.
111/// - Credentials are encoded as UTF-8 bytes.
112/// - CR/LF characters in username or password are rejected.
113#[cfg(feature = "basic-auth")]
114#[derive(Clone)]
115pub struct BasicAuth {
116    username: String,
117    password: String,
118}
119
120#[cfg(feature = "basic-auth")]
121impl BasicAuth {
122    /// Create new Basic auth credentials.
123    ///
124    /// # Errors
125    ///
126    /// Returns [`Error::InvalidAuthHeader`] if:
127    /// - The username contains `:`
128    /// - The username or password contains CR (`\r`) or LF (`\n`)
129    /// - The credentials produce an invalid header value
130    pub fn new(username: impl Into<String>, password: impl Into<String>) -> Result<Self> {
131        let username = username.into();
132        let password = password.into();
133
134        if username.contains(':') {
135            return Err(Error::InvalidAuthHeader(
136                "basic auth username must not contain ':'".into(),
137            ));
138        }
139
140        validate_auth_bytes(username.as_bytes(), "username")?;
141        validate_auth_bytes(password.as_bytes(), "password")?;
142
143        Ok(Self { username, password })
144    }
145
146    /// Returns the Base64-encoded header value (without the scheme prefix).
147    fn encoded_credentials(&self) -> String {
148        use base64::Engine;
149        let credential = format!("{}:{}", self.username, self.password);
150        base64::engine::general_purpose::STANDARD.encode(credential.as_bytes())
151    }
152
153    /// Returns the full `Authorization` header value.
154    fn header_value(&self) -> String {
155        format!("Basic {}", self.encoded_credentials())
156    }
157
158    /// Returns a reference to the username.
159    #[must_use]
160    pub fn username(&self) -> &str {
161        &self.username
162    }
163}
164
165#[cfg(feature = "basic-auth")]
166impl std::fmt::Debug for BasicAuth {
167    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
168        f.debug_struct("BasicAuth")
169            .field("username", &"<redacted>")
170            .field("password", &"<redacted>")
171            .finish()
172    }
173}
174
175#[cfg(feature = "basic-auth")]
176impl std::fmt::Display for BasicAuth {
177    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
178        f.write_str("BasicAuth(<redacted>)")
179    }
180}
181
182/// HTTP Bearer Token Authentication credentials.
183///
184/// Generates `Authorization: Bearer <token>` headers.
185///
186/// # Security
187///
188/// The `Debug` and `Display` implementations redact the token.
189/// The raw token is never exposed in error messages or logs.
190///
191/// # Validation
192///
193/// - CR (`\r`) and LF (`\n`) characters are rejected to prevent header injection.
194/// - No token format assumptions beyond header safety.
195#[derive(Clone)]
196pub struct BearerAuth {
197    token: String,
198}
199
200impl BearerAuth {
201    /// Create new Bearer auth credentials.
202    ///
203    /// # Errors
204    ///
205    /// Returns [`Error::InvalidAuthHeader`] if the token contains CR/LF
206    /// or produces an invalid header value.
207    pub fn new(token: impl Into<String>) -> Result<Self> {
208        let token = token.into();
209        validate_auth_bytes(token.as_bytes(), "token")?;
210        let header = format!("Bearer {token}");
211        http::HeaderValue::from_str(&header).map_err(|_| {
212            Error::InvalidAuthHeader(
213                "auth token must contain only characters valid in an HTTP header".into(),
214            )
215        })?;
216        Ok(Self { token })
217    }
218
219    /// Returns the full `Authorization` header value.
220    fn header_value(&self) -> String {
221        format!("Bearer {}", self.token)
222    }
223}
224
225impl std::fmt::Debug for BearerAuth {
226    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
227        f.debug_struct("BearerAuth")
228            .field("token", &"<redacted>")
229            .finish()
230    }
231}
232
233impl std::fmt::Display for BearerAuth {
234    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
235        write!(f, "BearerAuth(<redacted>)")
236    }
237}
238
239/// Validate that auth credential bytes are safe for use in header values.
240///
241/// Rejects CR and LF to prevent header injection.
242fn validate_auth_bytes(bytes: &[u8], field_name: &str) -> Result<()> {
243    if bytes.contains(&b'\r') {
244        return Err(Error::InvalidAuthHeader(format!(
245            "auth {field_name} must not contain CR"
246        )));
247    }
248    if bytes.contains(&b'\n') {
249        return Err(Error::InvalidAuthHeader(format!(
250            "auth {field_name} must not contain LF"
251        )));
252    }
253    Ok(())
254}
255
256/// Determine the effective auth for a request.
257///
258/// Precedence:
259/// 1. Request-level explicit auth
260/// 2. Request-level auth disabled
261/// 3. Client-level auth
262/// 4. No auth
263///
264/// If the request has an explicit `Authorization` header AND auth is
265/// configured, returns `Err` to avoid ambiguity (the user must choose
266/// one or the other).
267pub(crate) fn resolve_request_auth(
268    request_auth: Option<&AuthScheme>,
269    request_auth_disabled: bool,
270    client_auth: Option<&AuthScheme>,
271    request_headers: &crate::headers::Headers,
272) -> Result<Option<AuthScheme>> {
273    // Check for conflicting Authorization header + auth config.
274    if request_headers.contains("authorization") {
275        if request_auth.is_some() || client_auth.is_some() {
276            return Err(Error::ConflictingAuth(
277                "explicit Authorization header conflicts with configured auth; \
278                 use .auth() or remove the header, but not both"
279                    .into(),
280            ));
281        }
282        // User set a raw Authorization header with no auth config — that's fine.
283        return Ok(None);
284    }
285
286    // Request-level explicit auth overrides everything.
287    if let Some(auth) = request_auth {
288        return Ok(Some(auth.clone()));
289    }
290
291    // Request-level auth disabled.
292    if request_auth_disabled {
293        return Ok(None);
294    }
295
296    // Client-level auth.
297    if let Some(auth) = client_auth {
298        return Ok(Some(auth.clone()));
299    } // No auth.
300    Ok(None)
301}
302
303#[cfg(test)]
304mod tests {
305    use super::*;
306    #[cfg(feature = "basic-auth")]
307    use base64::Engine;
308
309    // --- BasicAuth tests ---
310
311    #[cfg(feature = "basic-auth")]
312    #[cfg(feature = "basic-auth")]
313    #[test]
314    fn basic_auth_header_value() {
315        let auth = BasicAuth::new("user", "pass").unwrap();
316        // user:pass = "dXNlcjpwYXNz" in base64
317        assert_eq!(auth.header_value(), "Basic dXNlcjpwYXNz");
318    }
319
320    #[cfg(feature = "basic-auth")]
321    #[test]
322    fn basic_auth_empty_password() {
323        let auth = BasicAuth::new("user", "").unwrap();
324        // user: = "dXNlcjo=" in base64
325        assert_eq!(auth.header_value(), "Basic dXNlcjo=");
326    }
327
328    #[cfg(feature = "basic-auth")]
329    #[test]
330    fn basic_auth_utf8_credentials() {
331        use base64::Engine;
332        let auth = BasicAuth::new("usér", "päss").unwrap();
333        assert!(auth.header_value().starts_with("Basic "));
334        // Verify it can be decoded
335        let header_val = auth.header_value();
336        let encoded = header_val.strip_prefix("Basic ").unwrap();
337        let decoded = base64::engine::general_purpose::STANDARD
338            .decode(encoded)
339            .unwrap();
340        assert_eq!(String::from_utf8(decoded).unwrap(), "usér:päss");
341    }
342
343    #[cfg(feature = "basic-auth")]
344    #[test]
345    fn basic_auth_rejects_colon_in_username() {
346        let err = BasicAuth::new("user:name", "pass").unwrap_err();
347        assert_eq!(err.kind(), "invalid_auth_header");
348        assert!(!err.to_string().contains("pass"));
349    }
350
351    #[cfg(feature = "basic-auth")]
352    #[test]
353    fn basic_auth_rejects_cr_in_username() {
354        let err = BasicAuth::new("user\r", "pass").unwrap_err();
355        assert_eq!(err.kind(), "invalid_auth_header");
356    }
357
358    #[cfg(feature = "basic-auth")]
359    #[test]
360    fn basic_auth_rejects_lf_in_password() {
361        let err = BasicAuth::new("user", "pass\n").unwrap_err();
362        assert_eq!(err.kind(), "invalid_auth_header");
363    }
364
365    #[cfg(feature = "basic-auth")]
366    #[test]
367    fn basic_auth_redacted_debug() {
368        let auth = BasicAuth::new("user", "secret123").unwrap();
369        let debug = format!("{auth:?}");
370        assert!(!debug.contains("\"user\""));
371        assert!(debug.contains("<redacted>"));
372        assert!(!debug.contains("secret123"));
373    }
374
375    #[cfg(feature = "basic-auth")]
376    #[test]
377    fn basic_auth_redacted_display() {
378        let auth = BasicAuth::new("user", "secret123").unwrap();
379        let display = format!("{auth}");
380        assert!(!display.contains("user"));
381        assert!(!display.contains("secret123"));
382        assert!(display.contains("<redacted>"));
383    }
384
385    #[cfg(feature = "basic-auth")]
386    #[test]
387    fn basic_auth_username_accessor() {
388        let auth = BasicAuth::new("admin", "pw").unwrap();
389        assert_eq!(auth.username(), "admin");
390    }
391
392    // --- BearerAuth tests ---
393
394    #[test]
395    fn bearer_auth_header_value() {
396        let auth = BearerAuth::new("my-token").unwrap();
397        assert_eq!(auth.header_value(), "Bearer my-token");
398    }
399
400    #[test]
401    fn bearer_auth_rejects_cr() {
402        let err = BearerAuth::new("tok\r").unwrap_err();
403        assert_eq!(err.kind(), "invalid_auth_header");
404    }
405
406    #[test]
407    fn bearer_auth_rejects_lf() {
408        let err = BearerAuth::new("tok\n").unwrap_err();
409        assert_eq!(err.kind(), "invalid_auth_header");
410    }
411
412    #[test]
413    fn bearer_auth_redacted_debug() {
414        let auth = BearerAuth::new("secret-token").unwrap();
415        let debug = format!("{auth:?}");
416        assert!(debug.contains("<redacted>"));
417        assert!(!debug.contains("secret-token"));
418    }
419
420    #[test]
421    fn bearer_auth_redacted_display() {
422        let auth = BearerAuth::new("secret-token").unwrap();
423        let display = format!("{auth}");
424        assert!(display.contains("<redacted>"));
425        assert!(!display.contains("secret-token"));
426    }
427
428    // --- AuthScheme tests ---
429
430    #[test]
431    fn auth_scheme_debug() {
432        #[cfg(feature = "basic-auth")]
433        {
434            let scheme = AuthScheme::basic("user", "pass").unwrap();
435            let debug = format!("{scheme:?}");
436            assert!(debug.contains("Basic"));
437        }
438
439        let scheme = AuthScheme::bearer("token").unwrap();
440        let debug = format!("{scheme:?}");
441        assert!(debug.contains("Bearer"));
442    }
443
444    // --- resolve_request_auth tests ---
445
446    #[test]
447    fn resolve_no_auth() {
448        let headers = crate::headers::Headers::new();
449        let result = resolve_request_auth(None, false, None, &headers).unwrap();
450        assert!(result.is_none());
451    }
452
453    #[test]
454    fn resolve_client_auth() {
455        let headers = crate::headers::Headers::new();
456        let client_auth = Some(AuthScheme::bearer("tok").unwrap());
457        let result = resolve_request_auth(None, false, client_auth.as_ref(), &headers).unwrap();
458        assert!(result.is_some());
459    }
460
461    #[test]
462    fn resolve_request_auth_overrides_client() {
463        let headers = crate::headers::Headers::new();
464        let request_auth = Some(AuthScheme::bearer("req-tok").unwrap());
465        let client_auth = Some(AuthScheme::bearer("client-tok").unwrap());
466        let result =
467            resolve_request_auth(request_auth.as_ref(), false, client_auth.as_ref(), &headers)
468                .unwrap();
469        let auth = result.unwrap();
470        match auth {
471            AuthScheme::Bearer(b) => {
472                assert_eq!(b.header_value(), "Bearer req-tok");
473            }
474            #[cfg(feature = "basic-auth")]
475            AuthScheme::Basic(_) => panic!("expected Bearer"),
476        }
477    }
478
479    #[test]
480    fn resolve_auth_disabled() {
481        let headers = crate::headers::Headers::new();
482        let client_auth = Some(AuthScheme::bearer("tok").unwrap());
483        let result = resolve_request_auth(None, true, client_auth.as_ref(), &headers).unwrap();
484        assert!(result.is_none());
485    }
486
487    #[test]
488    fn resolve_explicit_header_conflicts_with_auth() {
489        let mut headers = crate::headers::Headers::new();
490        headers.insert("authorization", "Bearer manual").unwrap();
491        let client_auth = Some(AuthScheme::bearer("tok").unwrap());
492        let err = resolve_request_auth(None, false, client_auth.as_ref(), &headers).unwrap_err();
493        assert_eq!(err.kind(), "conflicting_auth");
494    }
495
496    #[test]
497    fn resolve_explicit_header_no_auth_config() {
498        let mut headers = crate::headers::Headers::new();
499        headers.insert("authorization", "Bearer manual").unwrap();
500        let result = resolve_request_auth(None, false, None, &headers).unwrap();
501        assert!(result.is_none());
502    }
503
504    #[test]
505    fn resolve_request_auth_disabled_overrides_client() {
506        let headers = crate::headers::Headers::new();
507        let client_auth = Some(AuthScheme::bearer("tok").unwrap());
508        let result = resolve_request_auth(None, true, client_auth.as_ref(), &headers).unwrap();
509        assert!(result.is_none());
510    }
511
512    // --- Edge-case tests (Track C) ---
513
514    #[test]
515    fn resolve_no_auth_is_same_as_absent() {
516        let headers = crate::headers::Headers::new();
517        // None (not set) vs None (explicitly no auth) — same result
518        let r1 = resolve_request_auth(None, false, None, &headers).unwrap();
519        let r2 = resolve_request_auth(None, false, None, &headers).unwrap();
520        assert_eq!(r1.is_none(), r2.is_none());
521    }
522
523    #[cfg(feature = "basic-auth")]
524    #[test]
525    fn auth_scheme_debug_does_not_leak_basic_password() {
526        let scheme = AuthScheme::basic("admin", "hunter2").unwrap();
527        let debug = format!("{scheme:?}");
528        assert!(!debug.contains("admin"));
529        assert!(!debug.contains("hunter2"));
530        assert!(debug.contains("<redacted>"));
531    }
532
533    #[test]
534    fn auth_scheme_debug_does_not_leak_bearer_token() {
535        let scheme = AuthScheme::bearer("secret-value").unwrap();
536        let debug = format!("{scheme:?}");
537        assert!(!debug.contains("secret-value"));
538        assert!(debug.contains("<redacted>"));
539    }
540
541    #[cfg(feature = "basic-auth")]
542    #[test]
543    fn basic_auth_empty_username_and_password() {
544        let auth = BasicAuth::new("", "").unwrap();
545        // "" ":" "" → base64(":")
546        let expected = base64::engine::general_purpose::STANDARD.encode(b":");
547        assert_eq!(auth.header_value(), format!("Basic {expected}"));
548    }
549
550    #[test]
551    fn bearer_auth_empty_token() {
552        let auth = BearerAuth::new("").unwrap();
553        assert_eq!(auth.header_value(), "Bearer ");
554    }
555
556    #[cfg(feature = "basic-auth")]
557    #[test]
558    fn basic_auth_colon_in_password_is_allowed() {
559        let auth = BasicAuth::new("user", "p:a:s:s").unwrap();
560        let expected = base64::engine::general_purpose::STANDARD.encode(b"user:p:a:s:s");
561        assert_eq!(auth.header_value(), format!("Basic {expected}"));
562    }
563
564    #[test]
565    fn bearer_auth_with_spaces_in_token() {
566        let auth = BearerAuth::new("token with spaces").unwrap();
567        assert_eq!(auth.header_value(), "Bearer token with spaces");
568    }
569
570    #[test]
571    fn bearer_auth_with_unicode_token() {
572        let auth = BearerAuth::new("tökën-üñîçödé").unwrap();
573        assert!(auth.header_value().starts_with("Bearer "));
574        assert!(auth.header_value().contains("tökën-üñîçödé"));
575    }
576
577    #[cfg(feature = "basic-auth")]
578    #[test]
579    fn basic_auth_header_format() {
580        let auth = BasicAuth::new("user", "pass").unwrap();
581        let val = auth.header_value();
582        assert!(val.starts_with("Basic "), "must start with 'Basic '");
583        // The rest must be valid base64
584        let encoded = val.strip_prefix("Basic ").unwrap();
585        let decoded = base64::engine::general_purpose::STANDARD
586            .decode(encoded)
587            .unwrap();
588        assert_eq!(String::from_utf8(decoded).unwrap(), "user:pass");
589    }
590
591    #[test]
592    fn bearer_auth_header_format() {
593        let auth = BearerAuth::new("my-token-123").unwrap();
594        let val = auth.header_value();
595        assert_eq!(val, "Bearer my-token-123");
596    }
597
598    #[test]
599    fn double_resolution_is_idempotent() {
600        let headers = crate::headers::Headers::new();
601        let client_auth = Some(AuthScheme::bearer("client-tok").unwrap());
602        let request_auth = Some(AuthScheme::bearer("req-tok").unwrap());
603
604        // First resolution: request auth overrides client
605        let first =
606            resolve_request_auth(request_auth.as_ref(), false, client_auth.as_ref(), &headers)
607                .unwrap();
608        assert!(first.is_some());
609
610        // Second resolution: result + no auth → result passes through
611        let second = resolve_request_auth(first.as_ref(), false, None, &headers).unwrap();
612        match second.unwrap() {
613            AuthScheme::Bearer(b) => assert_eq!(b.header_value(), "Bearer req-tok"),
614            #[cfg(feature = "basic-auth")]
615            AuthScheme::Basic(_) => panic!("expected Bearer"),
616        }
617    }
618
619    #[test]
620    fn request_builder_without_auth_sets_disabled_and_clears_auth() {
621        let client = crate::client::Client::builder().build();
622        let req = client
623            .request(http::Method::GET, "http://example.com")
624            .unwrap()
625            .auth(AuthScheme::bearer("tok").unwrap())
626            .without_auth()
627            .build()
628            .unwrap();
629
630        assert!(req.is_auth_disabled());
631        assert!(req.auth().is_none());
632    }
633
634    #[test]
635    fn request_builder_auth_clears_disabled() {
636        let client = crate::client::Client::builder().build();
637        let req = client
638            .request(http::Method::GET, "http://example.com")
639            .unwrap()
640            .without_auth()
641            .auth(AuthScheme::bearer("tok").unwrap())
642            .build()
643            .unwrap();
644
645        assert!(!req.is_auth_disabled());
646        assert!(req.auth().is_some());
647    }
648
649    #[cfg(feature = "basic-auth")]
650    #[test]
651    fn basic_auth_display_shows_username_not_password() {
652        let auth = BasicAuth::new("admin", "s3cret").unwrap();
653        let display = format!("{auth}");
654        assert!(!display.contains("admin"));
655        assert!(!display.contains("s3cret"));
656        assert!(display.contains("<redacted>"));
657    }
658
659    #[test]
660    fn bearer_auth_display_redacts_token() {
661        let auth = BearerAuth::new("my-secret-token").unwrap();
662        let display = format!("{auth}");
663        assert!(!display.contains("my-secret-token"));
664        assert!(display.contains("<redacted>"));
665    }
666
667    #[cfg(feature = "basic-auth")]
668    #[test]
669    fn resolve_request_overrides_client_different_types() {
670        let headers = crate::headers::Headers::new();
671        let client_auth = Some(AuthScheme::basic("c", "cp").unwrap());
672        let request_auth = Some(AuthScheme::bearer("req-tok").unwrap());
673        let result =
674            resolve_request_auth(request_auth.as_ref(), false, client_auth.as_ref(), &headers)
675                .unwrap();
676        match result.unwrap() {
677            AuthScheme::Bearer(b) => assert_eq!(b.header_value(), "Bearer req-tok"),
678            AuthScheme::Basic(_) => panic!("expected Bearer"),
679        }
680    }
681}